DailyMarketProfile script (futures version) For ThinkOrSwim

chiropteraphile

New member
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.

Code:
#
#DailyMarketProfile script (futures version)
#@chiropteraphile  7/30/2022
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 = .236;
input coeff_2 = .327;
input coeff_3 = .500;
input coeff_4 = .618;
input coeff_5 = .789;
input coeff_6 = .882;

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(1);
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.Firm);
coeff2.SetLineWeight(1);
coeff2.HideBubble();
coeff2.HideTitle();

plot Halfback = 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;

Halfback.SetDefaultColor(Color.Dark_Orange);
Halfback.SetPaintingStrategy(PaintingStrategy.Line);
Halfback.SetStyle(Curve.Firm);
Halfback.SetLineWeight(2);
Halfback.HideBubble();
Halfback.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.Firm);
coeff6.SetLineWeight(1);
coeff6.HideBubble();
coeff6.HideTitle();
#
 
Last edited by a moderator:
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.

Code:
#
#DailyMarketProfile script (futures version)
#@chiropteraphile  7/30/2022
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 = .236;
input coeff_2 = .327;
input coeff_3 = .500;
input coeff_4 = .618;
input coeff_5 = .789;
input coeff_6 = .882;

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(1);
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.Firm);
coeff2.SetLineWeight(1);
coeff2.HideBubble();
coeff2.HideTitle();

plot Halfback = 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;

Halfback.SetDefaultColor(Color.Dark_Orange);
Halfback.SetPaintingStrategy(PaintingStrategy.Line);
Halfback.SetStyle(Curve.Firm);
Halfback.SetLineWeight(2);
Halfback.HideBubble();
Halfback.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.Firm);
coeff6.SetLineWeight(1);
coeff6.HideBubble();
coeff6.HideTitle();
#
Can you post a chart or two of your usage?
 
Here's both scripts working together on the /NQ, permarket this morning.

62xXa6U.png
 
This looks like it's picking the high and low of the entire prior day (day ending at 6pm ET), including the extended hours (if chart set to show extended hours).

Can it be changed to exclude extended hours from high and low determination, even if extended hours are shown on chart? I would have guessed the "plot overnight extremes" option was designed to handle this use case, but when I set it to "No", the script is still using the overnight range in its high/low determination.

/NQ with this study as the only study. Study settings:
length = 1
displace = 0
show only last period = yes
plot overnight extremes = no

6MnJW3.jpg
 
Updated to include fib extensions for this volatile market:



#
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 = .236;
input coeff_2 = .327;
input coeff_3 = .500;
input coeff_4 = .618;
input coeff_5 = .789;
input coeff_6 = .882;
input coeff_7 = 1.236;
input coeff_8 = 1.382;
input coeff_9 = 1.5;
input coeff_10 = 1.618;
input coeff_11 = 2.618;


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(1);
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.Firm);
coeff2.SetLineWeight(1);
coeff2.HideBubble();
coeff2.HideTitle();

plot Halfback = 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;
Halfback.SetDefaultColor(Color.Dark_Orange);
Halfback.SetPaintingStrategy(PaintingStrategy.Line);
Halfback.SetStyle(Curve.Firm);
Halfback.SetLineWeight(2);
Halfback.HideBubble();
Halfback.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.Firm);
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(1);
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.Firm);
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();
#
 
This overall layout is nice. I will implement some of the features here in a bit once I post some studies I have been asked to do.
 

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

Thread starter Similar threads Forum Replies Date
A Volume Threshold Script For ThinkOrSwim Custom 2
C Futures Market Profile Daily Levels For ThinkOrSwim Custom 0

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
279 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