How to keep horizontal lines for the last 50 candles?
-
How can I draw horizontal lines on the highs of the last 50 candles?
-
This is a initial Project.
https://fxdreema.com/shared/Trg60KbP
I have the impression that he is drawing the lines, but he is not leaving them fixed.
Ideally, for each new candle, the EA draws the 50 lines at the top of each candle and keeps them updated for each new 50 candles. -
Do you mean drawing the previous 50 candles, then waiting for the next 50 candles doing nothing and finally deleting the initial ones and drawing the last ones again?
-
@l-andorrà
imagine the following:
I'm on Candle 0 (current) and it's part of the 50 candles.
I want to put a horizontal line on the price of its high in real time and the high of the past 49 candles.
When this candle closes, I want the process to pass to another candle as this next candle becomes the current (0) candle again.
And so consequently the horizontal lines are always being redrawn over the new candles.
I believe I've seen someone drawing numbers on top of candles, but I've never seen anyone draw horizontal lines on a sequence of previous candles. -
My logic that I tried was the following:
Every tick (but could be every candle)
Execute 50x the variable block that will only add the value of the variable +1, this would generate from 1 to 50 in the variable that is linked to the candle ID of the "Draw Line" block.
As the Draw Line block is being repeated 50x with the Loop variable, then it would draw a horizontal line on top of each candle from candle 0 to candle 50.
But none of this is happening. -
So if I understand it correctly, you need this to happen every time a new candle is open:
- Look to back to the previous 49 candles.
- Find the high and the low prices for that 49 candles.
- Delete the previous plotted horizontal lines.
- Draw new lines on those new high and low.
And repeat again and again. Is that what you need?
-
Exactly that.
You explained in a few words what I want to do. -

-
@Byens
Thank you for your attention, but this only draws 1 line at the maximum price found in the period of 50 candles, I want 1 line for each of the 50 candles -
@OntradingX That's just an example. You need to duplicate that for lows too. That is the way to do it.
-
I need only for high price.
Have one example? -
@l-andorrà I need only for high price.
Have one example? -
If you need highs only then you can use the recommended configuration above.