Have successfully used the script below for 'simply sell' (& similarly 'simple buy') some time ago.
Tried it again now but keep getting 'error # 150' and no success
What may have changed? How does the code need to be updated?
Any support much appreciated, many thanks
dolphin44
<CODE REMOVED>
Have successfully used the script below for 'simply sell' (& similarly 'simple buy') some time ago.
Tried it again now but keep getting 'error # 150' and no success
Error 150 or error 130 ? 150 is a FIFO issue to do with closing orders not opening them . . .
If it's error 130 then your Broker is probably an ECN type Broker.
150 is a FIFO issue - the TP/SL must be equal or larger/smaller then the oldest open order so the oldest will close first.
130 is a ECN issue - open first and then set stops.
Always open first and then set stops and you'll isolate the problem.
Some US brokers implemented FIFO directly - thus breaking the mql4 model. Others (like IBFX) implemented it in the back office accounting (individual trades in accounting statements differ from mql4 statements.)
150 is a FIFO issue - the TP/SL must be equal or larger/smaller then the oldest open order so the oldest will close first.
130 is a ECN issue - open first and then set stops.
Always open first and then set stops and you'll isolate the problem.
Some US brokers implemented FIFO directly - thus breaking the mql4 model. Others (like IBFX) implemented it in the back office accounting (individual trades in accounting statements differ from mql4 statements.)
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Have successfully used the script below for 'simply sell' (& similarly 'simple buy') some time ago.
Tried it again but keep getting 'error # 130' and no success
What may have changed? How does the code need to be updated?
Any support much appreciated, many thanks
dolphin44