Pls help me create a loop

 

Hi

Could someone help me create this loop? I have no idea how to do it correctly

1. At the first step set a buy stop in distance 'x1' above current price and sell stop in the same distance below

2. If the buy and send are active (opened), set a buy stop in distance 'x2' above previous buy order and sell stop in the same distance below previous sell order

I will be grateful for yours help

Jacek

 

Hi j4ceeq,

Here is something to get you started...found a Pending Order EA thread...

It sets the buy/sell stops based on the extern user setting for the price level...

Take a look to see if you can modify it to do what you need...

Hope this helps,

Robert

pendingorderea.mq4

Files:
 

Ok, I have created first part of it It's working, but there are some warnings and I don't know how to add a second part to this expert

I would appreciate your help

Files:
expert.mq4  10 kb