MagicBlueBalls
New member
Could any chap in here make a "Double Top" version of Mobius Double Bottom? I have tried everything but no cigar.
Last edited by a moderator:
# Double Top \ Bottom
# Mobius
# Mod Sam4Cok
input Percent_A_to_C = .1;
input nP = 13;
input ShowValues = yes;
input ShowLines = yes;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def hh = fold j = 1 to nP + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (bar > nP and
h == Highest(h, nP) and
hh)
then h
else Double.NaN;
def PH1 = if !isNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else double.nan);
CondH1.SetDefaultColor(Color.WHITE);
CondH1.SetHiding(!ShowLines);
plot PivotHigh = PivotH;
PivotHigh.SetDefaultColor(Color.WHITE);
PivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
PivotHigh.SetHiding(!ShowValues);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.WHITE);
PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
PivotHDot.SetLineWeight(3);
# Double Bottom
def ll = fold jl = 1 to nP + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (bar > nP and
l == Lowest(l, nP) and
ll)
then l
else Double.NaN;
def PL1 = if !isNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else double.nan);
Cond1.SetDefaultColor(Color.Yellow);
Cond1.SetHiding(!ShowLines);
plot pivotLow = PivotL;
pivotLow.SetDefaultColor(Color.Yellow);
pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
pivotLow.SetHiding(!ShowValues);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.Yellow);
PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
PivotLDot.SetLineWeight(3);
# End Code
# Double Top \ Bottom
# Mobius
# Mod Sam4Cok
# Edited By ShadFX
# Combo Double Top and Bubbles
# Date: 12/13/2022
input Percent_A_to_C = .1;
#input nP = 3;
input ShowValues = yes;
input ShowLines = yes;
input ShowLabel = yes;
input blink = no;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def offset = 3;
def range = 2;
def ll = fold jl = range to offset + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (
l == Lowest(l, range) and
ll)
then l
else Double.NaN;
def hh = fold j = range to offset + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (
h == Highest(h, range) and
hh)
then h
else Double.NaN;
###########################
#DOUBLE TOP
def PH1 = if !IsNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if Between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else Double.NaN);
CondH1.SetDefaultColor(Color.DARK_RED);
CondH1.SetHiding(!ShowLines);
plot PivotHigh = PivotH;
PivotHigh.SetDefaultColor(Color.DARK_RED);
#PivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
PivotHigh.SetHiding(!ShowValues);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.DARK_RED);
#PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
PivotHDot.SetLineWeight(3);
# Double Bottom
def PL1 = if !IsNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if Between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else Double.NaN);
Cond1.SetDefaultColor(Color.DARK_GREEN);
Cond1.SetHiding(!ShowLines);
plot pivotLow = PivotL;
pivotLow.SetDefaultColor(Color.DARK_GREEN);
#pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
pivotLow.SetHiding(!ShowValues);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.DARK_GREEN);
#PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
PivotLDot.SetLineWeight(3);
#AddChartBubble(bar and pivotLow, low, if pivotLow then "UP" else "", Color.UPTICK, no);
#AddChartBubble(bar and pivotHigh, high, if pivotHigh then "DOWN" else "", Color.DOWNTICK, yes);
#def limit = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(bar);
def limit = !IsNaN(close) and IsNaN(close [-4] );
#AddChartBubble(bar and pivotLow and limit, low, if PivotL then "UP" else "", Color.UPTICK, no);
#AddChartBubble(bar and PivotHigh and limit, high, if PivotH then "DOWN" else "", Color.DOWNTICK, yes);
AddOrder(OrderType.BUY_AUTO, PivotLow, name = "B", tickColor = Color.WHITE, arrowColor = Color.WHITE);
AddOrder(OrderType.SELL_AUTO, PivotHigh, name = "S" , tickcolor = Color.WHITE, arrowcolor = Color.WHITE);
def ll = fold jl = range to offset + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (
l == Lowest(l, range) and
ll)
then l
else Double.NaN;
def hh = fold j = range to offset + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (
h == Highest(h, range) and
hh)
then h
else Double.NaN;
does this repaint?It finds the lowest low or highest high in a range of candles that are similar to a double top/bottom pattern.
This is the main portion I am working with. Basically the bottom two mirror the top two just inverted for high vs low.
Ruby:def ll = fold jl = range to offset + 1 with ql = 1 while ql do l < GetValue(low, -jl); def PivotL = if ( l == Lowest(l, range) and ll) then l else Double.NaN; def hh = fold j = range to offset + 1 with q = 1 while q do h > GetValue(h, -j); def PivotH = if ( h == Highest(h, range) and hh) then h else Double.NaN;
AddLabel(ShowLabel, "test123", if pivotLow then color.BLUE else if pivotHigh then color.DARK_ORANGE else Color.WHITE);
i see too many up& downs....almost for every 3-4 candles...and what are cond1 and condh1?Hello I am trying to fix this thinkscriptto update in real time. Not entirely sure if that requires repaint or not, but was wondering if anyone could provide some insight on what may be missing.
UPDATE: Found Sam4Cok edit. Trying to have the candle get labeled right after the match. Right now it takes the nP or x candles after the bubble candle for it to actually populate the bubble. So instead of testing x number of candles after... instead search a range before such as 5 candles and then compare with the 2 previous candles. If the 2 previous trigger the match then the active candle should immediately get labeled.
Credit to Mobius for the original script
Credit to Sam4Cok for mod
![]()
Ruby:# Double Top \ Bottom # Mobius # Mod Sam4Cok # Edited By ShadFX # Combo Double Top and Bubbles # Date: 12/13/2022 input Percent_A_to_C = .1; #input nP = 3; input ShowValues = yes; input ShowLines = yes; input ShowLabel = yes; input blink = no; def AC = Percent_A_to_C / 100; def h = high; def l = low; def bar = BarNumber(); def Ps = 1 + AC; def Ns = 1 - AC; def offset = 3; def range = 2; def ll = fold jl = range to offset + 1 with ql = 1 while ql do l < GetValue(low, -jl); def PivotL = if ( l == Lowest(l, range) and ll) then l else Double.NaN; def hh = fold j = range to offset + 1 with q = 1 while q do h > GetValue(h, -j); def PivotH = if ( h == Highest(h, range) and hh) then h else Double.NaN; ########################### #DOUBLE TOP def PH1 = if !IsNaN(PivotH) then h else PH1[1]; def PH2 = if PH1 != PH1[1] then PH1[1] else PH2[1]; def CheckH1 = if Between(PH2, PH1 * Ns, PH1 * Ps) then 1 else 0; plot CondH1 = HighestAll(if CheckH1 then PH2 else Double.NaN); CondH1.SetDefaultColor(Color.DARK_RED); CondH1.SetHiding(!ShowLines); plot PivotHigh = PivotH; PivotHigh.SetDefaultColor(Color.DARK_RED); #PivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE); PivotHigh.SetHiding(!ShowValues); plot PivotHDot = PivotH; PivotHDot.SetDefaultColor(Color.DARK_RED); #PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotHDot.SetLineWeight(3); # Double Bottom def PL1 = if !IsNaN(PivotL) then l else PL1[1]; def PL2 = if PL1 != PL1[1] then PL1[1] else PL2[1]; def Check1 = if Between(PL2, PL1 * Ns, PL1 * Ps) then 1 else 0; plot Cond1 = HighestAll(if Check1 then PL2 else Double.NaN); Cond1.SetDefaultColor(Color.DARK_GREEN); Cond1.SetHiding(!ShowLines); plot pivotLow = PivotL; pivotLow.SetDefaultColor(Color.DARK_GREEN); #pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); pivotLow.SetHiding(!ShowValues); plot PivotLDot = PivotL; PivotLDot.SetDefaultColor(Color.DARK_GREEN); #PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotLDot.SetLineWeight(3); #AddChartBubble(bar and pivotLow, low, if pivotLow then "UP" else "", Color.UPTICK, no); #AddChartBubble(bar and pivotHigh, high, if pivotHigh then "DOWN" else "", Color.DOWNTICK, yes); #def limit = !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(bar); def limit = !IsNaN(close) and IsNaN(close [-4] ); #AddChartBubble(bar and pivotLow and limit, low, if PivotL then "UP" else "", Color.UPTICK, no); #AddChartBubble(bar and PivotHigh and limit, high, if PivotH then "DOWN" else "", Color.DOWNTICK, yes); AddOrder(OrderType.BUY_AUTO, PivotLow, name = "B", tickColor = Color.WHITE, arrowColor = Color.WHITE); AddOrder(OrderType.SELL_AUTO, PivotHigh, name = "S" , tickcolor = Color.WHITE, arrowcolor = Color.WHITE);
@samer800 thanks for this script, I would like to have a horizontal line plot across the pivotlow with this but it only plots a dash...how can i get the line drawn? Thankstry this, i am not expert but hope this work.
# Tops \ Bottoms
# Mobius
# Modified C.Ricks 12/22/22
input Percent_A_to_C = .1;
input nP = 13;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def hh = fold j = 1 to nP + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (bar > nP and
h == Highest(h, nP) and
hh)
then h
else Double.NaN;
def PH1 = if !isNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else double.nan);
CondH1.SetDefaultColor(Color.WHITE);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.WHITE);
PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# Double Bottom
def ll = fold jl = 1 to nP + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (bar > nP and
l == Lowest(l, nP) and
ll)
then l
else Double.NaN;
def PL1 = if !isNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else double.nan);
Cond1.SetDefaultColor(Color.White);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.White);
PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# End Code
Hi,Since I only like turning points I revamped this a bit to give White Dots at high/low turning points as follows:
# Tops \ Bottoms
# Mobius
# Modified C.Ricks 12/22/22
input Percent_A_to_C = .1;
input nP = 13;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def hh = fold j = 1 to nP + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (bar > nP and
h == Highest(h, nP) and
hh)
then h
else Double.NaN;
def PH1 = if !isNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else double.nan);
CondH1.SetDefaultColor(Color.WHITE);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.WHITE);
PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# Double Bottom
def ll = fold jl = 1 to nP + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (bar > nP and
l == Lowest(l, nP) and
ll)
then l
else Double.NaN;
def PL1 = if !isNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else double.nan);
Cond1.SetDefaultColor(Color.White);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.White);
PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# End Code
How real time is this ?Since I only like turning points I revamped this a bit to give White Dots at high/low turning points as follows:
# Tops \ Bottoms
# Mobius
# Modified C.Ricks 12/22/22
input Percent_A_to_C = .1;
input nP = 13;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def hh = fold j = 1 to nP + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (bar > nP and
h == Highest(h, nP) and
hh)
then h
else Double.NaN;
def PH1 = if !isNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else double.nan);
CondH1.SetDefaultColor(Color.WHITE);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.WHITE);
PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# Double Bottom
def ll = fold jl = 1 to nP + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (bar > nP and
l == Lowest(l, nP) and
ll)
then l
else Double.NaN;
def PL1 = if !isNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else double.nan);
Cond1.SetDefaultColor(Color.White);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.White);
PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# End Code
How real time is this ?
@samer800 thanks for this script, I would like to have a horizontal line plot across the pivotlow with this but it only plots a dash...how can i get the line drawn? Thanks
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.Yellow);
PivotLDot.SetPaintingStrategy(PaintingStrategy.hoRIZONTAL);
PivotLDot.SetLineWeight(3);
Thanks @samer800 for this code. This one looks perfect for DT/DB too.try this, i am not expert but hope this work.
Ruby:# Double Top \ Bottom # Mobius # Mod Sam4Cok input Percent_A_to_C = .1; input nP = 13; input ShowValues = yes; input ShowLines = yes; def AC = Percent_A_to_C / 100; def h = high; def l = low; def bar = BarNumber(); def Ps = 1 + AC; def Ns = 1 - AC; def hh = fold j = 1 to nP + 1 with q = 1 while q do h > GetValue(h, -j); def PivotH = if (bar > nP and h == Highest(h, nP) and hh) then h else Double.NaN; def PH1 = if !isNaN(PivotH) then h else PH1[1]; def PH2 = if PH1 != PH1[1] then PH1[1] else PH2[1]; def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps) then 1 else 0; plot CondH1 = HighestAll(if CheckH1 then PH2 else double.nan); CondH1.SetDefaultColor(Color.WHITE); CondH1.SetHiding(!ShowLines); plot PivotHigh = PivotH; PivotHigh.SetDefaultColor(Color.WHITE); PivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE); PivotHigh.SetHiding(!ShowValues); plot PivotHDot = PivotH; PivotHDot.SetDefaultColor(Color.WHITE); PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotHDot.SetLineWeight(3); # Double Bottom def ll = fold jl = 1 to nP + 1 with ql = 1 while ql do l < GetValue(low, -jl); def PivotL = if (bar > nP and l == Lowest(l, nP) and ll) then l else Double.NaN; def PL1 = if !isNaN(PivotL) then l else PL1[1]; def PL2 = if PL1 != PL1[1] then PL1[1] else PL2[1]; def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps) then 1 else 0; plot Cond1 = HighestAll(if Check1 then PL2 else double.nan); Cond1.SetDefaultColor(Color.Yellow); Cond1.SetHiding(!ShowLines); plot pivotLow = PivotL; pivotLow.SetDefaultColor(Color.Yellow); pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); pivotLow.SetHiding(!ShowValues); plot PivotLDot = PivotL; PivotLDot.SetDefaultColor(Color.Yellow); PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotLDot.SetLineWeight(3); # End Code
Hi Samer800, can you please provide scan for pivotHigh and PivotLow?try this, i am not expert but hope this work.
Ruby:# Double Top \ Bottom # Mobius # Mod Sam4Cok input Percent_A_to_C = .1; input nP = 13; input ShowValues = yes; input ShowLines = yes; def AC = Percent_A_to_C / 100; def h = high; def l = low; def bar = BarNumber(); def Ps = 1 + AC; def Ns = 1 - AC; def hh = fold j = 1 to nP + 1 with q = 1 while q do h > GetValue(h, -j); def PivotH = if (bar > nP and h == Highest(h, nP) and hh) then h else Double.NaN; def PH1 = if !isNaN(PivotH) then h else PH1[1]; def PH2 = if PH1 != PH1[1] then PH1[1] else PH2[1]; def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps) then 1 else 0; plot CondH1 = HighestAll(if CheckH1 then PH2 else double.nan); CondH1.SetDefaultColor(Color.WHITE); CondH1.SetHiding(!ShowLines); plot PivotHigh = PivotH; PivotHigh.SetDefaultColor(Color.WHITE); PivotHigh.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE); PivotHigh.SetHiding(!ShowValues); plot PivotHDot = PivotH; PivotHDot.SetDefaultColor(Color.WHITE); PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotHDot.SetLineWeight(3); # Double Bottom def ll = fold jl = 1 to nP + 1 with ql = 1 while ql do l < GetValue(low, -jl); def PivotL = if (bar > nP and l == Lowest(l, nP) and ll) then l else Double.NaN; def PL1 = if !isNaN(PivotL) then l else PL1[1]; def PL2 = if PL1 != PL1[1] then PL1[1] else PL2[1]; def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps) then 1 else 0; plot Cond1 = HighestAll(if Check1 then PL2 else double.nan); Cond1.SetDefaultColor(Color.Yellow); Cond1.SetHiding(!ShowLines); plot pivotLow = PivotL; pivotLow.SetDefaultColor(Color.Yellow); pivotLow.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); pivotLow.SetHiding(!ShowValues); plot PivotLDot = PivotL; PivotLDot.SetDefaultColor(Color.Yellow); PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS); PivotLDot.SetLineWeight(3); # End Code
# https://usethinkscript.com/threads/double-top-and-double-bottom-for-thinkorswim.11391/
# Tops \ Bottoms
# Mobius
# Modified C.Ricks 12/22/22
input Percent_A_to_C = .1;
input nP = 13;
input DisplayLabels = Yes;
def AC = Percent_A_to_C / 100;
def h = high;
def l = low;
def bar = BarNumber();
def Ps = 1 + AC;
def Ns = 1 - AC;
def hh = fold j = 1 to nP + 1
with q = 1
while q
do h > GetValue(h, -j);
def PivotH = if (bar > nP and
h == Highest(h, nP) and
hh)
then h
else Double.NaN;
def PH1 = if !isNaN(PivotH)
then h
else PH1[1];
def PH2 = if PH1 != PH1[1]
then PH1[1]
else PH2[1];
def CheckH1 = if between(PH2, PH1 * Ns, PH1 * Ps)
then 1
else 0;
plot CondH1 = HighestAll(if CheckH1
then PH2
else double.nan);
CondH1.SetDefaultColor(Color.WHITE);
plot PivotHDot = PivotH;
PivotHDot.SetDefaultColor(Color.WHITE);
PivotHDot.SetPaintingStrategy(PaintingStrategy.POINTS);
# Double Bottom
def ll = fold jl = 1 to nP + 1
with ql = 1
while ql
do l < GetValue(low, -jl);
def PivotL = if (bar > nP and
l == Lowest(l, nP) and
ll)
then l
else Double.NaN;
def PL1 = if !isNaN(PivotL)
then l
else PL1[1];
def PL2 = if PL1 != PL1[1]
then PL1[1]
else PL2[1];
def Check1 = if between(PL2, PL1 * Ns, PL1 * Ps)
then 1
else 0;
plot Cond1 = HighestAll(if Check1
then PL2
else double.nan);
Cond1.SetDefaultColor(Color.White);
plot PivotLDot = PivotL;
PivotLDot.SetDefaultColor(Color.White);
PivotLDot.SetPaintingStrategy(PaintingStrategy.POINTS);
AddChartBubble(DisplayLabels && PivotLDot, low, "Double bottom", Color.YELLOW, yes);
AddChartBubble(DisplayLabels && PivotHDot, high, "Double top", Color.WHITE, yes);
# End Code
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
![]() |
Repaints Bulkowski Double Bottom Indicator for ThinkorSwim | Indicators | 11 | |
H | TOP Ultimate Breakout Indicator for ThinkorSwim | Indicators | 120 | |
![]() |
UCSGears Top and Bottom Candle Identifier for Thinkorswim | Indicators | 15 |
Start a new thread and receive assistance from our community.
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.
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.