Hello,
Can someone please help me to build a simple tool that will plot a dot or an arrow every time three consecutive higher green or lower red candles appear? Basically a legstart of the swing. The problem is, I would like to plot an arrow/dot on that first candle (beginning of the legstart), not the last candle nor the all candles...but the first candle..(of course the dot will appear after all candles are completed so after 3 candles).
This is what i came up with so far:
def candle = open < close;
def leg =((candle > candle[1]) and (candle[1] > candle[2]) and (candle[2] > candle[3]));
plot LegStart = if leg then Lowest(leg) else Double.NaN;
LegStart.setpaintingStrategy(paintingStrategy.POINTS);
LegStart.setLineWeight(3);
LegStart .setdefaultColor(Color.WHITE);
Can someone please help me to build a simple tool that will plot a dot or an arrow every time three consecutive higher green or lower red candles appear? Basically a legstart of the swing. The problem is, I would like to plot an arrow/dot on that first candle (beginning of the legstart), not the last candle nor the all candles...but the first candle..(of course the dot will appear after all candles are completed so after 3 candles).
This is what i came up with so far:
def candle = open < close;
def leg =((candle > candle[1]) and (candle[1] > candle[2]) and (candle[2] > candle[3]));
plot LegStart = if leg then Lowest(leg) else Double.NaN;
LegStart.setpaintingStrategy(paintingStrategy.POINTS);
LegStart.setLineWeight(3);
LegStart .setdefaultColor(Color.WHITE);