Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
return NormalizeDouble(basePrice + (double)steps * stepPips * multiplier, (int)MarketInfo(Symbol(), MODE_DIGITS));
But for the current symbol you don't need MarketInfo:
return NormalizeDouble(basePrice + (double)steps * stepPips * multiplier, Digits());
Yaw Owusu Ampong: How do I resolve the warning on this code line . Compilation warning. your help will be appreciated
The function MarketInfo() returns a "double" data-type, but the 2nd parameter of NormaliseDouble() expects an "int" data-type.
Since it is an implicit typecasting, it warns you of the situation, so use an explicit type-casting to resolve the issue:
return NormalizeDouble( basePrice + (double) steps * stepPips * multiplier, (int) MarketInfo( Symbol(), MODE_DIGITS ) );
Be aware that normalizing prices to Digits can lead to invalid prices. The right way is to normalize to tick size.
Same for lots, you don't need to normalize to 2 decimal digits, but to lot step.
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
How do I resolve the warning on this code line
Compilation warning
your help will be appreciated