Aurelien Pierre Laval: Someone can explain me what is wrong please?
-
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problemWe can't see your broken code.
-
We don't even know that you are trying to open a sell order.

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
Hello, I am developping an EA and sometimes when I try to buy or send, I get the error message (sometimes, the transaction is OK) :
failed market sell 4.71 #TSLA sl: 42.86 [Invalid stops]
CTrade::OrderSend: market sell 4.71 #TSLA sm: 42.86 [invalid stops]
I understand than my stop loss is wrong but I don't understand why because the point is 0.01 and the difference between the bid and the stop loss is more than 0.01.
This is all information about the transaction:
- bid: 42.43
- stop loss: 42.86
- point: 0.01
This is how I calcultate the stop loss:
The idea is to have a stop loss calculated in percentage from the bid because it's easier for me.
In the above exemple, the stop loss is at 1 percent from the bid.
Someone can explain me what is wrong please?
Thanks