Daily Market Profile For ThinkOrSwim

chiropteraphile

New member
Plots the current daily high, low, and halfback, updates dynamically in real time (lines move with price action intraday).
Code:
#
#DailyLevels script
#@chiropteraphile  7/30/2022
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = 0;
input showOnlyLastPeriod = yes;

def prevPrice = open(period = aggregationPeriod)[-1];
def price = open(period = aggregationPeriod);

plot DailyOpen = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
DailyOpen.SetDefaultColor(Color.White);
DailyOpen.SetPaintingStrategy(PaintingStrategy.Line);
DailyOpen.SetStyle(Curve.Short_Dash);
DailyOpen.SetLineWeight(2);
DailyOpen.HideBubble();
DailyOpen.HideTitle();

plot DailyHigh;
plot DailyLow;

if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
DailyHigh = Double.NaN;
DailyLow = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(Color.Green);

DailyHigh.SetPaintingStrategy(PaintingStrategy.Line);

DailyHigh.SetStyle(Curve.Short_Dash);

DailyHigh.SetLineWeight(1);

DailyHigh.HideBubble();

DailyHigh.HideTitle();


DailyLow.SetDefaultColor(Color.Red);

DailyLow.SetPaintingStrategy(PaintingStrategy.Line);

DailyLow.SetStyle(Curve.Short_Dash);

DailyLow.SetLineWeight(1);

DailyLow.HideBubble();

DailyLow.HideTitle();



plot Halfback;
Halfback = (DailyHigh + DailyLow)/2;

Halfback.SetDefaultColor(Color.Dark_Orange);

Halfback.SetPaintingStrategy(PaintingStrategy.Line);

Halfback.SetStyle(Curve.Short_Dash);

Halfback.SetLineWeight(1);

Halfback.HideBubble();

Halfback.HideTitle();

#
 
Last edited by a moderator:
Added more fib extensions for this volatile market, and updated formatting: 0 and 100% are heavier weighted lines, minor fib (809, 191) lines are dashes, current day halfback is orange.

Original version plots the pervious day's close, high, low, and halfback, the overnight high and low, and fib levels for futures.
Combine with my DailyLevels script (https://usethinkscript.com/threads/dailylevels-script.12073) for trading with intraday price levels.

Futures version only, sorry. Please feel free to adapt for the stonks.

Enjoy.

___________________________________

#

declare hide_on_daily;

input aggregationPeriod = AggregationPeriod.DAY;

input length = 1;

input displace = -1;

input showOnlyLastPeriod = no;

plot PrevDayClose;

Plot PrevDayHigh;

Plot PrevDayLow;



if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;

} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);

}

PrevDayClose.SetDefaultColor(Color.White);

PrevDayClose.SetPaintingStrategy(PaintingStrategy.Line);

PrevDayClose.SetStyle(Curve.Firm);

PrevDayClose.SetLineWeight(2);

PrevDayClose.HideBubble();

PrevDayClose.HideTitle();

if showOnlyLastPeriod and !IsNaN(high(period = aggregationPeriod)[-1]) { PrevDayHigh = Double.NaN;

} else { PrevDayHigh = Highest(high(period = aggregationPeriod)[-displace], length);

}



PrevDayHigh.SetDefaultColor(Color.Green);

PrevDayHigh.SetPaintingStrategy(PaintingStrategy.Line);

PrevDayHigh.SetStyle(Curve.Firm);

PrevDayHigh.SetLineWeight(2);

PrevDayHigh.HideBubble();

PrevDayHigh.HideTitle();

if showOnlyLastPeriod and !IsNaN(Low(period = aggregationPeriod)[-1]) { PrevDayLow = Double.NaN;

} else { PrevDayLow = Highest(Low(period = aggregationPeriod)[-displace], length);

}



PrevDayLow.SetDefaultColor(Color.Red);

PrevDayLow.SetPaintingStrategy(PaintingStrategy.Line);

PrevDayLow.SetStyle(Curve.Firm);

PrevDayLow.SetLineWeight(2);

PrevDayLow.HideBubble();

PrevDayLow.HideTitle();





input PlotOverNightExtremes = yes;



input coeff_1=-2;



input coeff_2=-1.191;

input coeff_3=-1.382;

input coeff_4=-1.5;

input coeff_5=-1.618;

input coeff_6=-1.809;

input coeff_7=-1;



input coeff_8=-0.191;

input coeff_9=-0.382;

input coeff_10=-0.5;

input coeff_11=-0.618;

input coeff_12=-0.809;

input coeff_13=0;



input coeff_14=0.191;

input coeff_15=0.382;

input coeff_16=0.5;

input coeff_17=0.618;

input coeff_18=0.809;

input coeff_19=1;



input coeff_20=1.191;

input coeff_21=1.382;

input coeff_22=1.5;

input coeff_23=1.618;

input coeff_24=1.809;

input coeff_25=2;



input coeff_26=2.191;

input coeff_27=2.382;

input coeff_28=2.5;

input coeff_29=2.618;

input coeff_30=2.809;

input coeff_31=3;





def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !Globex[1]

then v

else if GlobeX

then vol[1] + v

else Double.NaN;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !Globex[1]

then h

else if Globex and

h > ONhigh[1]

then h

else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

then Bar

else double.nan;

def ONlow = if GlobeX and !GlobeX[1]

then l

else if GlobeX and

l < ONlow[1]

then l

else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

then Bar

else double.nan;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

then ONhigh

else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

then ONlow

else OverNightLow[1];

plot ONH = if OverNightHigh > 0

then OverNightHigh

else Double.NaN;



ONH.SetHiding(!PlotOverNightExtremes);

ONH.SetPaintingStrategy(PaintingStrategy.Line);

ONH.SetDefaultColor(Color.Light_Green);

ONH.SetStyle(Curve.Firm);

ONH.SetLineWeight(2);

ONH.HideBubble();

ONH.HideTitle();



plot ONL = if OverNightLow > 0

then OverNightLow

else Double.NaN;



ONL.SetHiding(!PlotOverNightExtremes);

ONL.SetPaintingStrategy(PaintingStrategy.Line);

ONL.SetDefaultColor(Color.Light_Red);

ONL.SetStyle(Curve.Firm);

ONL.SetLineWeight(2);

ONL.HideBubble();

ONL.HideTitle();



def MaxBar = Max(HighestAll(ONhighBar), HighestAll(ONlowBar));



plot coeff1 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_1) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_1)

else double.nan;

coeff1.SetDefaultColor(Color.Gray);

coeff1.SetPaintingStrategy(PaintingStrategy.Line);

coeff1.SetStyle(Curve.Firm);

coeff1.SetLineWeight(2);

coeff1.HideBubble();

coeff1.HideTitle();



plot coeff2 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_2) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_2)

else double.nan;

coeff2.SetDefaultColor(Color.Gray);

coeff2.SetPaintingStrategy(PaintingStrategy.Line);

coeff2.SetStyle(Curve.LONG_DASH);

coeff2.SetLineWeight(1);

coeff2.HideBubble();

coeff2.HideTitle();



plot coeff3 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_3) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_3)

else double.nan;

coeff3.SetDefaultColor(Color.Gray);

coeff3.SetPaintingStrategy(PaintingStrategy.Line);

coeff3.SetStyle(Curve.Firm);

coeff3.SetLineWeight(1);

coeff3.HideBubble();

coeff3.HideTitle();



plot coeff4 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_4) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_4)

else double.nan;

coeff4.SetDefaultColor(Color.Gray);

coeff4.SetPaintingStrategy(PaintingStrategy.Line);

coeff4.SetStyle(Curve.Firm);

coeff4.SetLineWeight(1);

coeff4.HideBubble();

coeff4.HideTitle();



plot coeff5 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_5) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_5)

else double.nan;

coeff5.SetDefaultColor(Color.Gray);

coeff5.SetPaintingStrategy(PaintingStrategy.Line);

coeff5.SetStyle(Curve.Firm);

coeff5.SetLineWeight(1);

coeff5.HideBubble();

coeff5.HideTitle();



plot coeff6 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_6) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_6)

else double.nan;

coeff6.SetDefaultColor(Color.Gray);

coeff6.SetPaintingStrategy(PaintingStrategy.Line);

coeff6.SetStyle(Curve.LONG_DASH);

coeff6.SetLineWeight(1);

coeff6.HideBubble();

coeff6.HideTitle();



plot coeff7 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_7) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_7)

else double.nan;

coeff7.SetDefaultColor(Color.Gray);

coeff7.SetPaintingStrategy(PaintingStrategy.Line);

coeff7.SetStyle(Curve.Firm);

coeff7.SetLineWeight(2);

coeff7.HideBubble();

coeff7.HideTitle();



plot coeff8 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_8) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_8)

else double.nan;

coeff8.SetDefaultColor(Color.Gray);

coeff8.SetPaintingStrategy(PaintingStrategy.Line);

coeff8.SetStyle(Curve.LONG_DASH);

coeff8.SetLineWeight(1);

coeff8.HideBubble();

coeff8.HideTitle();



plot coeff9 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_9) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_9)

else double.nan;

coeff9.SetDefaultColor(Color.Gray);

coeff9.SetPaintingStrategy(PaintingStrategy.Line);

coeff9.SetStyle(Curve.Firm);

coeff9.SetLineWeight(1);

coeff9.HideBubble();

coeff9.HideTitle();



plot coeff10 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_10) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_10)

else double.nan;

coeff10.SetDefaultColor(Color.Gray);

coeff10.SetPaintingStrategy(PaintingStrategy.Line);

coeff10.SetStyle(Curve.Firm);

coeff10.SetLineWeight(1);

coeff10.HideBubble();

coeff10.HideTitle();



plot coeff11 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_11) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_11)

else double.nan;

coeff11.SetDefaultColor(Color.Gray);

coeff11.SetPaintingStrategy(PaintingStrategy.Line);

coeff11.SetStyle(Curve.Firm);

coeff11.SetLineWeight(1);

coeff11.HideBubble();

coeff11.HideTitle();



plot coeff12 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_12) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_12)

else double.nan;

coeff12.SetDefaultColor(Color.Gray);

coeff12.SetPaintingStrategy(PaintingStrategy.Line);

coeff12.SetStyle(Curve.LONG_DASH);

coeff12.SetLineWeight(1);

coeff12.HideBubble();

coeff12.HideTitle();



plot coeff13 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_13) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_13)

else double.nan;

coeff13.SetDefaultColor(Color.Gray);

coeff13.SetPaintingStrategy(PaintingStrategy.Line);

coeff13.SetStyle(Curve.Firm);

coeff13.SetLineWeight(2);

coeff13.HideBubble();

coeff13.HideTitle();



plot coeff14 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_14) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_14)

else double.nan;

coeff14.SetDefaultColor(Color.Gray);

coeff14.SetPaintingStrategy(PaintingStrategy.Line);

coeff14.SetStyle(Curve.LONG_DASH);

coeff14.SetLineWeight(1);

coeff14.HideBubble();

coeff14.HideTitle();



plot coeff15 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_15) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_15)

else double.nan;

coeff15.SetDefaultColor(Color.Gray);

coeff15.SetPaintingStrategy(PaintingStrategy.Line);

coeff15.SetStyle(Curve.Firm);

coeff15.SetLineWeight(1);

coeff15.HideBubble();

coeff15.HideTitle();



plot coeff16 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_16) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_16)

else double.nan;

coeff16.SetDefaultColor(Color.DARK_ORANGE);

coeff16.SetPaintingStrategy(PaintingStrategy.Line);

coeff16.SetStyle(Curve.Firm);

coeff16.SetLineWeight(1);

coeff16.HideBubble();

coeff16.HideTitle();



plot coeff17 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_17) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_17)

else double.nan;

coeff17.SetDefaultColor(Color.Gray);

coeff17.SetPaintingStrategy(PaintingStrategy.Line);

coeff17.SetStyle(Curve.Firm);

coeff17.SetLineWeight(1);

coeff17.HideBubble();

coeff17.HideTitle();



plot coeff18 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_18) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_18)

else double.nan;

coeff18.SetDefaultColor(Color.Gray);

coeff18.SetPaintingStrategy(PaintingStrategy.Line);

coeff18.SetStyle(Curve.LONG_DASH);

coeff18.SetLineWeight(1);

coeff18.HideBubble();

coeff18.HideTitle();



plot coeff19 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_19) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_19)

else double.nan;

coeff19.SetDefaultColor(Color.Gray);

coeff19.SetPaintingStrategy(PaintingStrategy.Line);

coeff19.SetStyle(Curve.Firm);

coeff19.SetLineWeight(2);

coeff19.HideBubble();

coeff19.HideTitle();



plot coeff20 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_20) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_20)

else double.nan;

coeff20.SetDefaultColor(Color.Gray);

coeff20.SetPaintingStrategy(PaintingStrategy.Line);

coeff20.SetStyle(Curve.LONG_DASH);

coeff20.SetLineWeight(1);

coeff20.HideBubble();

coeff20.HideTitle();



plot coeff21 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_21) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_21)

else double.nan;

coeff21.SetDefaultColor(Color.Gray);

coeff21.SetPaintingStrategy(PaintingStrategy.Line);

coeff21.SetStyle(Curve.Firm);

coeff21.SetLineWeight(1);

coeff21.HideBubble();

coeff21.HideTitle();



plot coeff22 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_22) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_22)

else double.nan;

coeff22.SetDefaultColor(Color.Gray);

coeff22.SetPaintingStrategy(PaintingStrategy.Line);

coeff22.SetStyle(Curve.Firm);

coeff22.SetLineWeight(1);

coeff22.HideBubble();

coeff22.HideTitle();



plot coeff23 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_23) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_23)

else double.nan;

coeff23.SetDefaultColor(Color.Gray);

coeff23.SetPaintingStrategy(PaintingStrategy.Line);

coeff23.SetStyle(Curve.Firm);

coeff23.SetLineWeight(1);

coeff23.HideBubble();

coeff23.HideTitle();



plot coeff24 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_24) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_24)

else double.nan;

coeff24.SetDefaultColor(Color.Gray);

coeff24.SetPaintingStrategy(PaintingStrategy.Line);

coeff24.SetStyle(Curve.LONG_DASH);

coeff24.SetLineWeight(1);

coeff24.HideBubble();

coeff24.HideTitle();



plot coeff25 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_25) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_25)

else double.nan;

coeff25.SetDefaultColor(Color.Gray);

coeff25.SetPaintingStrategy(PaintingStrategy.Line);

coeff25.SetStyle(Curve.Firm);

coeff25.SetLineWeight(2);

coeff25.HideBubble();

coeff25.HideTitle();



plot coeff26 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_26) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_26)

else double.nan;

coeff26.SetDefaultColor(Color.Gray);

coeff26.SetPaintingStrategy(PaintingStrategy.Line);

coeff26.SetStyle(Curve.LONG_DASH);

coeff26.SetLineWeight(1);

coeff26.HideBubble();

coeff26.HideTitle();



plot coeff27 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_27) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_27)

else double.nan;

coeff27.SetDefaultColor(Color.Gray);

coeff27.SetPaintingStrategy(PaintingStrategy.Line);

coeff27.SetStyle(Curve.Firm);

coeff27.SetLineWeight(1);

coeff27.HideBubble();

coeff27.HideTitle();



plot coeff28 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_28) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_28)

else double.nan;

coeff28.SetDefaultColor(Color.Gray);

coeff28.SetPaintingStrategy(PaintingStrategy.Line);

coeff28.SetStyle(Curve.Firm);

coeff28.SetLineWeight(1);

coeff28.HideBubble();

coeff28.HideTitle();



plot coeff29 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_29) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_29)

else double.nan;

coeff29.SetDefaultColor(Color.Gray);

coeff29.SetPaintingStrategy(PaintingStrategy.Line);

coeff29.SetStyle(Curve.Firm);

coeff29.SetLineWeight(1);

coeff29.HideBubble();

coeff29.HideTitle();



plot coeff30 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_30) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_30)

else double.nan;

coeff30.SetDefaultColor(Color.Gray);

coeff30.SetPaintingStrategy(PaintingStrategy.Line);

coeff30.SetStyle(Curve.LONG_DASH);

coeff30.SetLineWeight(1);

coeff30.HideBubble();

coeff30.HideTitle();



plot coeff31 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then ((OverNightHigh - OverNightLow) * coeff_31) + OverNightLow

else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_31)

else double.nan;

coeff31.SetDefaultColor(Color.Gray);

coeff31.SetPaintingStrategy(PaintingStrategy.Line);

coeff31.SetStyle(Curve.Firm);

coeff31.SetLineWeight(2);

coeff31.HideBubble();

coeff31.HideTitle();

#
 
/NQ with above script


UdCcRac.png
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
466 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top