
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I did run this script to check:
and got no error message.
When the EA detects an Open position, (in demo) it correctly sets my SL to 7.5 and my TP to 15.0. It also places a Limit order 3.5 away to close half the position (trading futures). When price reaches that target, the EA then moves SL to Open +/- 0.25.
However, in Live account, the EA gives error 4756 and retcode 10016 and it seems to be trying to set the SL to 0.25 in profit and so far 3 trades have closed at 0.25 profit.
Okay, I have more info: The EA places the Limit order before modifying SL and TP. I also have a Global variable set to either 0 or 1, depending on if it finds the Limit order. On the demo, it places the Limit order and sets the Global variable to 1. After price reaches it, the variable is set back to 0. However, on Live account the Limit order disappears immediately (at least when placed using my original script; not sure if the EA places it), and the EA sets the Global variable to 1. This triggers my Break Even code to try to move the SL to 0.25 in profit. Hence, the error. I even opened the GV (F3) and set it to 0 and it immediately was reset to 1 with no Limit order visible on the screen or in the Trade tab.
Now, why would the code respond differently on a Live account than a Demo? And why does my Limit order seem to disappear? And how does the GV get set to 1 if the only code to change it, is if it finds the Limit order and the GV is 0, or after placing the Limit order only if the GV is 0?
There is code to delete the Limit order but only if it finds no Open trades and the Limit order is only placed after there is an open trade.