Reference to candle price (setting an id for candle maybe? )
-
Dear Community I m a newbie here ,
And hope someone can help to this issue i faced.I want to set "condition" for Ea to make it trade or cancelling trade once price is touch (high/Low) of specific candle (predetermined) at the past.
So i believe I required to give a reference to candle to include it in "condition".
I know the current ID is 0 once we go back 1 step a time Candle id is incresing n+1 and so on.However i wanted to reference to prices of fixed candle in past.
Pls help me to find it out.
Thanks.
-
@azfireland Does it mean you want eg the candle that is 10 candles away? So just put ID10 for instance. Or what is the issue? Maybe I didn't get you right.
-
Dear @trader-philipps , Let me put it that way, we can set condition to EA to buy if price reach all time recorded highest high. Which is formed 10 candles away so, Id of 10 candles away will be "10" when next candle is formed, ID of that candle will be "11" and will continue increase as new candles formed. So when ea place order it will buy if price reach highest high of last 10 candles not the all time recorded highest high. please refer the image below
What i want to say is that, as time passes and new candle is formed and ID is changing . i need to reference price of fixed candle in history not the last 10 candle. hope its clear now.
-

-
Use a variable target_ID
- At beginning set target_ID as 10
- On every new candle, target_ID = target_ID+1
Now the ID changes as time passes, but the reference candle stays the same.
-
@azfireland Would that do the trick?

If you need thecandle ID you can the "What to get" part to candle ID.
-
@trader-philipps @roar Great it works.
Thanks.