This EA is designed to place a number of buy and sell pending limit trades, using the TradesAboveBelow parameter. When the EA loads, it gets the current Bid price and places the specified number of trades above and below that Bid price, all spaced according to other variables. This part works just fine. It's supposed to keep a count of the trades so that when either the buys or the sells count goes lower than the variable, it finds the last trade from history, gets that trade's OpenOrderPrice, and places a new pending buy or sell limit order to replace the trade that closed with profit. Basically, there should always be the specified number of trades above and below the Bid price on the board at any one time.
Where I'm running into problems is when the EA replaces a trade, it does so correctly, but it often places too many trades causing my count to be above the specified variable, which then causes other EA functions not to work properly.
Can anyone suggest anything that may be causing this? I don't claim to know everything about coding, but i've never run into this before. Thanks.
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.
Hello,
This EA is designed to place a number of buy and sell pending limit trades, using the TradesAboveBelow parameter. When the EA loads, it gets the current Bid price and places the specified number of trades above and below that Bid price, all spaced according to other variables. This part works just fine. It's supposed to keep a count of the trades so that when either the buys or the sells count goes lower than the variable, it finds the last trade from history, gets that trade's OpenOrderPrice, and places a new pending buy or sell limit order to replace the trade that closed with profit. Basically, there should always be the specified number of trades above and below the Bid price on the board at any one time.
Where I'm running into problems is when the EA replaces a trade, it does so correctly, but it often places too many trades causing my count to be above the specified variable, which then causes other EA functions not to work properly.
Can anyone suggest anything that may be causing this? I don't claim to know everything about coding, but i've never run into this before. Thanks.