Eric Gonzalez:
How can I check If the current trade is open in order to avoid the enterTrade functionality while it is opened?
How can I check If the current trade is open in order to avoid the enterTrade functionality while it is opened?
Do you mean to stop opening new trade if there's an open trade? If that's the case you can store the ticket of the open trade and if you close the trade you set the ticket variable to 0 for next signal.
Eric Gonzalez:
"failed market sell 0.1 XAUEUR sl: 1877.52 tp: 1869.75 [Invalid stops]"
"failed market sell 0.1 XAUEUR sl: 1877.52 tp: 1869.75 [Invalid stops]"
Invalid stop related to stoploss and take profit placement and also stop level. First check if stoploss price and take profit price is correct, stoploss below open price and take profit above open price for buy position and stoploss above open price and take profit below open price if it's sell.
If stoploss price and take profit price is correct you can check stop level. Stop level related to minimum stoploss and take profit price away from open price.

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
Hi Everyone,
I'm developing my EA. The thing is that I want to make only one trade each time. How can I check If the current trade is open in order to avoid the enterTrade functionality while it is opened?
And also I've noticed that I had some problems related to "failed market sell 0.1 XAUEUR sl: 1877.52 tp: 1869.75 [Invalid stops]"
Here's my code:
Thanks in advance!