I've been working on an EA that is supposed to move all positions stop losses to entry, if the last order hit take profit. The EA is restricted to 3 positions. The code below that I've written moves the first position stop loss to entry, but doesn't affect any of the other positions, and I wanted to know why is this the case during my backtest analyses.
For reference I also get Error 130, 1, and 4180 randomly in my error log. Just wondering if I could get a little guidance as to how to correct my code so that all positions have their stop loss moved to entry/order open price.
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi guys,
I've been working on an EA that is supposed to move all positions stop losses to entry, if the last order hit take profit. The EA is restricted to 3 positions. The code below that I've written moves the first position stop loss to entry, but doesn't affect any of the other positions, and I wanted to know why is this the case during my backtest analyses.
For reference I also get Error 130, 1, and 4180 randomly in my error log. Just wondering if I could get a little guidance as to how to correct my code so that all positions have their stop loss moved to entry/order open price.
Thanks!