Hi guys,
Am trying to create a simple EA that sets pending buy/sell STOP orders at previous bar high & low. See below
there are 2 issues I'm having:
1. OP_BUYSTOP order is placed but SL and TP are not correct (not 20 & 60 pips away, they're the other way around, very strange..?
2. OP_SELLSTOP order is never placed. I get OrderSend Error130, cannot figure out why
Appreciate any help, sorry I'm a newbie!
You have to check your prices : open price, stoploss & takeprofit. Open price must be below market for a SELL_STOP, where are you checking it ?
Also check stoplevel as suggested by "Top-SecreT".
Check this document for the rules to follow when placing an order :

- book.mql4.com
Thanks guys for your replies.
Rather than use Bid & Ask for SL/TP levels, I am simply using the High[] & Low[] for TP/SL . This works as intended.
Thanks also Alain for reference to Trade Requirements & Limitations, very very handy.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
Am trying to create a simple EA that sets pending buy/sell STOP orders at previous bar high & low. See below
there are 2 issues I'm having:
1. OP_BUYSTOP order is placed but SL and TP are not correct (not 20 & 60 pips away, they're the other way around, very strange..?
2. OP_SELLSTOP order is never placed. I get OrderSend Error130, cannot figure out why
Appreciate any help, sorry I'm a newbie!