Another ThinkScript post got me thinking about Dual Tops & Bottoms (sometimes indicative of a turn in direction) and so I came up with the following script. I use it on my AsGoodAsItGets indicator for 5 minute charts and above (It's a little too busy on shorter time frames). If someone smarter than me can improve on it I would be appreciative?
Ruby:
#AsGoodAsItGets_DualTops/Bottoms
#Double Tops/Bottoms frequently show potential swings in direction especially if one of the Tops/Bottoms has a long Wick above the Dual Top Candles; or a Long Wick below Dual Bottom Candles. This is also significant if the DB or DT shows superimposed on_"AsGoodAsItGets" indicator Long or Short Bubbles.
#This may be a little too busy for charts less than 5 minutes.
#Charles Ricks 10/18/22 Thanks to ThinkScript Forum the idea!
#AsGoodAsItGets_DualTops/Bottoms
#Double Tops/Bottoms frequently show potential swings in direction especially if one of the Tops/Bottoms has a long Wick above the Top Candles or a Long Wick below candles. This is also significant if the DB or DT shows superimposed on_volume abandonedBaby AsGoodAsItGets Long or Short Bubble.
#May be a little too busy for charts less than 5 minutes.
#Charles Ricks 10/18/22 Thanks to ThinkScript Forum the idea!
#
def SL1 = 10000;
def SH1 = 0;
def DoubleTop = if high == high[1]
then if high < high[2] and high < high[-1]
then 1
else 0
else if high < high[1] and high < high[-1]
then 1
else 0;
plot SW = if DoubleTop then low else Double.NaN;
AddChartBubble(DoubleTop, low, "DB", Color.green
, no);
def DoubleBottom = if low == low[1]
then if low < low[2] and low < low[-1]
then 1
else 0
else if low > low[1] and low > low[-1]
then 1
else 0;
plot SW1 = if DoubleBottom then low else Double.NaN;
SW1.SetLineWeight(5);
AddChartBubble(DoubleBottom, high, "DT", Color.red
, yes);
Last edited by a moderator: