Down Trend Doji Candle Finder for ThinkorSwim


New member
So I am new here and figured I would contribute a little something...This is a simple script that looks for a doji with a tail at the bottom of a downtrend, the tail usually signifies it dipped enough to wipe out stops then with the liquidity shot back up good way of spotting the bottom you can also use it in a scanner just add it as a custom study and select the plot 'Bullish' and the value to be true.

I use it at the end of the day/week/month but you could use it on shorter time frames no repainting either so the signal is reliable to find the pattern but should be used with other indicators for confirmation. I like this study b/c it doesn't rely on any math or MA's it is looking for a bar pattern which is pretty unique for most studies...


Here is the code in doesn't catch them all but it is a rather simple code...

#shadow factor looks for tails based  body height of the candle in a downtrend  the idea was to find tails at the bottom of downtrend setup signifying liquidity being bought

input downtrendSetup = 6; #Number of bars to calculate downtrend slope...not all of these bars have to be descending as long as the overall value is neg it is descending

input shadowFactor = 1; #size of tail in relation to body  higher number less signals can be like .50 for more signals just not below zero or zero

assert(shadowFactor >0, "'shadow factor' must not be negative or zero: " + shadowFactor);

def BodyHeight = BodyHeight();

plot Bullish = IsDescending(close, downtrendSetup) and low<low[1] and low[1]<low[2] and low[2]<low[3]
    Min(open, close) - low > shadowFactor * BodyHeight;

Last edited by a moderator:


The latest version of TOS? seem to have an option to change the color if the candle is Doji on Appearance tab for the chart settings. Would that replace this indicator?

Similar threads