Modification of Pending Stop Orders

 

Hi guys,

I’m interested in strategy that modifies pending stop orders price (buy stop and sell stop) in that way that it keeps both at the same distance from the market. So if the market moves up, buy stop pending order as well as sell stop pending order will go up and vice versa. Is it possible to have such strategy?

I tried to do something based on https://book.mql4.com/trading/ordermodify section “Modification of Pending Orders”.

So I had 2 strategies on:

- - one exactly from the example from this site,

- -second where I have changed in block 9 in case 4 greater than sign to less than sign and in case 5 less than sign to greater than sign

It works when there is only one stop pending order, so if I put buy stop pending order and turn on those two strategies, let say for EURUSD than it works, the pending order keeps a const distance. However when I have two pending orders, buy stop and sell stop then it works only for sell stop. For buy stop I have only alert that there is no conditions to modify the order. When I kill sell stop order than it starts working for buy stop. The case is that I want strategy to work when both stop orders are in. I have checked code and really can’t find where is an issue hide. Can someone help me with this please? All help appreciated.

Thanks in advance,

Cheers,

Piotr N

 
novvyy:

if the market moves up, buy stop pending order as well as sell stop pending order will go up and vice versa. Is it possible to have such strategy?


Why move up buystop pending order when market goes up

or vice versa why move down sellstop pending order when market goes down ??

ofcours it is possible to have such strategy but you will never open a trade with the pending trades...

 
deVries:


Why move up buystop pending order when market goes up

or vice versa why move down sellstop pending order when market goes down ??

ofcours it is possible to have such strategy but you will never open a trade with the pending trades...

You will when there is a spike on the market like for example during important economic numbers realese.