Hi Gentlemen,
I use a powerful method to define support and resistance levels.
I’d like to automatically plot horizontal rays in order to define them. I currently do it manually but it’s a hassle.
First let’s define a breakout:
Look at the ¨breakout¨ image.
Candle 2 is completely below the high of candle 1 (high [candle2] < high[candle1])
AND
Candle 3 closed below the low of candle 2 (close [candle3] < low[candle2])
AND
Candle 4 makes a new low vs candle 3 (low [candle4] < low[candle3])
There is breakout of the green ray there so this one isn’t valid and shouldn’t be drawn.
Now let’s define a NO breakout:
Look at the ¨No breakout¨ image.
Candle 2 is completely below the high of candle 1 (high [candle2] < high[candle1])
AND
Candle 3 didn’t close below the low of candle 2 (close [candle3] > low[candle2]) OR Candle 3 closed below the low of candle 2 (close [candle3] < low[candle2])
AND
Candle 4 didn’t make a new low vs candle 3 (low [candle4] > low[candle3])
There is No breakout of the green ray there, so this one is valid, and that ray should be drawn. On top of that candle 4 closed above the ray (close [candle4] > high[candle1]) so it validates the line for good, meaning that if we breakout that ray to the downside, it should stay in place and a new dynamic ray should be created until validated.
Basically, the green horizontal ray is showing the level that the bears couldn’t breakout.
This works also on the upside, but highs have to be used instead of the low in the formula.
I manually plot on daily, weekly, Monthly, quarterly and yearly.
I’ve attached an example of what I manually plotted on SPX.
Do you think it is possible to code such on chart indicator?
If so, can anyone help?
Thanks in advance.
Cheers.
Franck.