Strategy Question about Modifying stoploss on orders

 

Hello,

Most examples I have seen, send an ordermodify, once the trailing stop is hit that is, with EVERY tick hereafter. Is this the right way to do it? It seems to require a lot of processing time and will generate warnings since the modify orders are coming in too fast for the server. Wouldn't make more sense if you modify the order say every minute once? Or is with every tick the standard way?

Thanks

F.T.

 
forexnology:

Hello,

Most examples I have seen, send an ordermodify, once the trailing stop is hit that is, with EVERY tick hereafter. Is this the right way to do it? It seems to require a lot of processing time and will generate warnings since the modify orders are coming in too fast for the server. Wouldn't make more sense if you modify the order say every minute once? Or is with every tick the standard way?

Thanks

F.T.


every tick is possibel standard if the price change also in the way you need/want.

Even every minute, you have to compare the current Stoploss and the "new" Stoploss and change (OrderModify..) only if there is a difference.

See https://book.mql4.com/trading/ordermodify,also about MODE_STOPLEVEL

 
forexnology:

Hello,

Most examples I have seen, send an ordermodify, once the trailing stop is hit that is, with EVERY tick hereafter. Is this the right way to do it? It seems to require a lot of processing time and will generate warnings since the modify orders are coming in too fast for the server. Wouldn't make more sense if you modify the order say every minute once? Or is with every tick the standard way?

Thanks

F.T.



In my trailing stoploss routine I have the code set a flag to indicate the stoploss needs adjusting, that flag then signals that a calculation is to be done regarding the "lag" or intentional delay the EA is to take before submitting the ordermodify request.

The time is random and is anywhere from 1minute to 5 minutes. If in the meantime the market has moved such that the trailing stoploss price has changed yet again then the EA uses the most recent relevant trailing SL when actually committing the ordermodify to the server.

I have to do this to accommodate the fact that at any given time I might have 20+ windows in the same terminal updating stops and there might be anywhere from 3 to 10 accounts (terminal instances) active at the same time. The activity just needs to be intelligently managed when there is that much going on.
Reason: