Hi everyone.
I'm using the StopsLevel() and FreezeLevel() methods of the CSymbolInfo class to help calculate the minimum stop-level for an open position. I'm getting 40pips returned in StopsLevel() for EURUSD so I'm subtracting 0.0004 from the ASK price before placing a BUY order.
My problem is that sometimes this still results in an 'invalid stops' error (10016).
I've spoken to my broker and they said that it's because the ASK price might be slightly different to the current market price at the time.
Has anyone else had experience with this?
Is there a reliable way to calculate a minimum stop-level without risking an 'invalid stops' error in MQL5?
Thanks in advance
Chris
If you place the stoploss at the exact stoplevel you can have this error with a market order (not always but more or less often). Market price is moving you know.
A stoplevel of 0.0004 is not 40 pips but 4 pips or 40 points (the stoplevel is given in points). And by the way 4 pips is a lot, which broker is it ? Demo or live account ?
Hi Alain,
I've been setting up my trades exactly as you have suggested but I still sometimes get invalid stops.
Hi Alain,
I've been setting up my trades exactly as you have suggested but I still sometimes get invalid stops.
That means that your broker has larger stop loss tolerance levels than the ones you are trying to establish.
Change either your stop loss levels or your broker, there are some brokers with zero stop loss tolerance levels.
Thanks Eleni,
That was the sort of response I was looking for.
I think I'll research other brokers
Thanks Eleni,
That was the sort of response I was looking for.
I think I'll research other brokers
With any broker if you try to place a stoploss at the stoplevel price, you will always get invalid stops error from time to time.
Of course the difference is a better broker will not fix a 4 pips stoplevel.
With any broker if you try to place a stoploss at the stoplevel price, you will always get invalid stops error from time to time.
Of course the difference is a better broker will not fix a 4 pips stoplevel.
what would be a good recommended level past the stoplevel price to place it at? my broker is IG and they do have a 4 pips stoplevel, I dont want to change it at the moment and would prefer to have flexible code that can deal with it.
Any suggestions for a reliable multiplier vs the stoplevel?
thanks!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone.
I'm using the StopsLevel() and FreezeLevel() methods of the CSymbolInfo class to help calculate the minimum stop-level for an open position. I'm getting 40pips returned in StopsLevel() for EURUSD so I'm subtracting 0.0004 from the ASK price before placing a BUY order.
My problem is that sometimes this still results in an 'invalid stops' error (10016).
I've spoken to my broker and they said that it's because the ASK price might be slightly different to the current market price at the time.
Has anyone else had experience with this?
Is there a reliable way to calculate a minimum stop-level without risking an 'invalid stops' error in MQL5?
Thanks in advance
Chris