How to create a "Trailing Pending Stop Order EA"

 

Hello,

is it possible to create an ea with following instructions?

I want set two pending orders (buystop and sellstop). It looks like a straddle or OCO ea, but its a little different.

This two pending orders are adjusted x pips (extern value ex. 10 pips) away from entry price.

So if you have a current price 1.2439 then buystop should be 1.2449 and sellstop 1.2429.

And now i want modify the pendings after each tick. If price goes to 1.2450 then buystop should be 1.2460 and sellstop 1.2440. There should be a stoploss x pips away (extern value ex. 10 pips) and if one pending order is triggered the other should be delete. Then trail the stoploss until stopout (extern value Trailstep 1 pip).

I found an ea who can do this in a simple way for one order and only one direction. It is called "TPSO.ex4".

You can see how it works on youtube:

https://www.youtube.com/watch?v=CpSqdMkhimQ

This is the original website:

Afterburner FX - zyskowne inwestycje na rynku kapitałowym | Download EA - ex4 file - Forex - Robot Afterburner - Forex Expert Advisor

I know that this ea will claim the MT4 because there are many modify orders in the statement.

But is it possible to create. I don't no how. I'm not a coder, sorry.

Thanks for your help!

Regards

Daniel

 
mondalsys:
Hello,

is it possible to create an ea with following instructions?

I want set two pending orders (buystop and sellstop). It looks like a straddle or OCO ea, but its a little different.

This two pending orders are adjusted x pips (extern value ex. 10 pips) away from entry price.

So if you have a current price 1.2439 then buystop should be 1.2449 and sellstop 1.2429.

And now i want modify the pendings after each tick. If price goes to 1.2450 then buystop should be 1.2460 and sellstop 1.2440. There should be a stoploss x pips away (extern value ex. 10 pips) and if one pending order is triggered the other should be delete. Then trail the stoploss until stopout (extern value Trailstep 1 pip).

I found an ea who can do this in a simple way for one order and only one direction. It is called "TPSO.ex4".

You can see how it works on youtube:

https://www.youtube.com/watch?v=CpSqdMkhimQ

This is the original website:

Afterburner FX - zyskowne inwestycje na rynku kapitałowym | Download EA - ex4 file - Forex - Robot Afterburner - Forex Expert Advisor

I know that this ea will claim the MT4 because there are many modify orders in the statement.

But is it possible to create. I don't no how. I'm not a coder, sorry.

Thanks for your help!

Regards

Daniel

mondalsys

If you always change the price of the pending order, it will never be executed (the pending order)

 

@mladen:

Yes thats right normally. But i want try something.

Sometimes the price make a high jump after news and when the MT4 can not modify the pending order as soon as possible then maybe the order would be triggered. I want test it. Or does anyone test it?

 
mondalsys:
@mladen:

Yes thats right normally. But i want try something.

Sometimes the price make a high jump after news and when the MT4 can not modify the pending order as soon as possible then maybe the order would be triggered. I want test it. Or does anyone test it?

mondalsys

You told the following :

And now i want modify the pendings after each tick

If you change the pending order price on each tick the chances that your pending order is triggered is close to 0 (only in cases of big gaps on a new tick could trigger them). In any normal circumstance it will never be triggered (executed) if you change the price of the pending order on each new tick

 
mladen:
(only in cases of big gaps on a new tick could trigger them)

Would it be possible to create an expert for this test?

 
mondalsys:
Would it be possible to create an expert for this test?

Those gaps (from one tick to another) are happening only on surprise rate changes and some extraordinary central banks decisions - once in month or two. Adjusting the pending orders prices by simply dragging them on chart will cover 99.9999% of cases

 

Hi mladen, please would you help to add protect stop loss to this EA? i.e. if price move +100pips, it will automatic move stoploss to +30pips to protect some profits if the market decided to turnaround.

stoploss_and_takeprofit_manager.mq4

Reason: