
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
Of course it is market info and i am the Who advised you to use it.
OK, this is really strange!!!
When i try to move my stop 50 points down, to 97250, I receive:
When i try to move my stop 83 points down, to 97217, I receive:
When i try to move my stop 84 points down, to 96216
When i try to move my stop 85 points down, to 97215 I receive:
When i try to move my stop 100 points down, to 97200 I receive:
All of this happens in the same candle at the same time. the code is:
And the same occurs if i just input the price in PositionModify function.
edit:It seems that If the price of SL is multiple of 5, PositionModify works very well
WIN$20 has a tick size of 5, you need to normalize all your prices according to it. Market price is moving by step of 5 so prices like 97216 or 97217 are invalid.
Forum on trading, automated trading systems and testing trading strategies
Need help to round order last digit to 0 or 5
Alain Verleyen, 2016.10.23 18:47
Normalize your price like that :
//| Normalize price according to tick size |
//+------------------------------------------------------------------+
double normalizePrice(double price)
{
double tickSize=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE);
return(MathRound(price/tickSize)*tickSize);
}
Double-precision floating-point format - Wikipedia, the free encyclopedia
See also The == operand. - MQL4 programming forum
MT4:NormalizeDouble - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum
What is a TICK? - MQL4 programming forum
NormalizeDouble, It's use is usually wrong, as it is might be in your case.
Double-precision floating-point format - Wikipedia, the free encyclopedia
See also The == operand. - MQL4 programming forum
MT4:NormalizeDouble - MQL5 programming forum
How to Normalize - Expert Advisors and Automated Trading - MQL5 programming forum
What is a TICK? - MQL4 programming forum
You come late
and he didn't even use NormalizeDouble().
You come late
and he didn't even use NormalizeDouble().
Thank you guys for the help!!
I came with a similar solution to NormalizeDouble but loved to read about what William Roeder wrote and understand a bit more of the problem we are facing here..
Really really thank you everyone!
See ya!