Disliked...when the A1 (2) was reached, the A2 (0) activates and moves my SL...B1 (3), SL one more time moves to B2 (1) pips, everything still fine, but then the market price suddenly drops to back to A1 (2), at this point, the A condition much stops running and the SL would be B2 (1), but instead, one more time the SL moves back to A2 (0), again and again between A2 and B2. The same case has happened with the C condition. I want to add a code that when the A condition was already activated it much stop immediately, and only counted the B and C conditions,...Ignored
a_limit = 2; a_sl = 0;
b_limit = 3; b_sl = 1;
c_limit = 4; c_sl = 2;
When price reaches limit x, move to sl y. Say for a buy order, if you dont want the A condition to be re-triggered when price falls back below the B region, you can include in the check for the A condition, that price hasn't moved higher than the B limit, because if price has moved higher than b_limit, then a_limit would have been triggered. Something like-
//A for buys
if(price>=a_limit, and the highest-high since the order entry is lower than b_limit, and the ordersl is not already a_sl)move sl to a_sl
Use high[] with the index of the ihighest() from live to the order candle index. See documentation for ihighest().