I am trying to get an ea that:
-
runs from a defined start time to an end time
-
opens pending orders at a certain time of the day
-
checks how each trade ended up (TP/SL/TS)
-
Counts for each pair it runs on the number of TP SL TS trades of today
-
If the amount of trades are under a certain value the ea should check:
6a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should place a new pending order at a certain level
6b) if since the last closed buy trade of the pair the opened above a certain level and if this is true it should place a new pending order at a certain level
7a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order
7b) if since the last closed buy trade of the pair the price opened above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order
i have no problems with 1 and 2. I also tried to work with a loop but this didn’t work.
So i would be very grateful if i could get some help for points 3-7, thank you

EDIT:
Here is what i have so far but it still doesnt seem to work 
https://fxdreema.com/shared/j2GlTgNbd