IsDoji ( int length, double bodyFactor);
true if the current candle is Doji (i.e. its Close price and Open price are equal or almost the same) and
false otherwise. Note that a candle is considered Doji if its body height does not exceed average body height multiplied by the specified factor. The average body height is calculated for a specified number of preceding candles.
|length||20||Defines period on which average body height is calculated.|
|factor||0.05||Defines factor by which the average body height is multiplied.|
input length = 25;
def IsDoji = IsDoji(length);
plot ThreeDoji = IsDoji and
This example marks the last of three consecutive Doji candles. In this case, a candle will be considered Doji if its body height does not exceed 5% (default value) of the average body height calculated for last 25 candles.