is there an "If hit stoploss" feature or anything like that?

 

For example with martingale kinda system


if SLR = 0

"open trade (lotsize 0,1) "

if SLR = 1

"open trade (lotsize 0,1) "

if SLR = 2

"open trade (lotsize 0,3) "

if SLR = 3

"open trade (lotsize 0,8) "

if SLR = 4

"open trade (lotsize 0,12) "


If hit stoploss, set SLR to +1


Do you guys get what I mean?

 

To detect that an order has been stopped (by the broker via the S/L you set in the order, rather than a S/L that you implement locally in your EA), then you need to programmatically search the order history pool and react accordingly.


CB