How do I make ea to save the id (probably timestamp) of a particular candle for future trade setup confirmation
-

Please I need to create an ea for my trading strategy which goes like this,
For Sell,
Step 1. 100 ema (red) below 150 ema (green)
Step 2. A candle opens below and closes above the slow ema
Step 3. Later on, as long as the 100 ema stays below the 150, the first candle that opens above and closes below the 100 ema
Step 4. Sell at the close of that candle
(and vice versa for buy)I've shared a pic of the setup above, as you can see the strategy simply states that (for sell trade) sell at the close of the FIRST bearish candle to cross 100ema down after a bullish candle crossed the 150ema up in the past.
I know that for step 3 I'll put the candle Id as 1, so that my order will be placed at its close below 100ema. Seeing as I must give my entry candle the "id of 1" what "id" do I put for the step 2 candle in the condition block that shows when the previous cross above the 150ema occurred. This previous candle could be 1 candle in the past, 2, 3, 5, 10 or even 20 candles backwards so I don't know how to create the ea using this candle id method.
I thought of this, is there a way to set the ea such that after step 2 occurs it stores the time stamp of that candle and later on when step 3 is fulfilled, it places the order and resets its memory so it can analyze (store time stamp of next step 2 candle, whenever step 3 is fulfilled, place order) the next setup.
This is currently the only thing I could think up but I've looked at fxdreema's toolbox and I don't think it can be done. Please help me out

♂️
♂️
♂️ -
@daverazon That is not a trivial thing to do. What I'm thinking of right now is creating a variable that will add +1 every time a new candle is created. That way you can now the candle position in the future. However, combining that with the other features will need fine tuning. Do you have any initial project to begin with?
-
@l-andorrà thanks a lot for looking into it for me. I've also tried other methods but it's evident that the current fxdreema can't perform this kind of function. I'll try out another strategy.
-
@daverazon You're welcome.