how to sell or buy when it reach it step and time frame not fulfil

 

for example i buy trade by martingle EA buy and it losing 240 points or 24 pips it will buy another buy

but i want EA to maintain time frame too.

what changes is require in EA to fulfil my requirements