Here is another approach of mine:
try to detect if Symbol() is XAU (GOLD) or any other "2 decimal places pair", used for MaxSpread detection (multiplier = 10 does not work, it must be 100), find the symbolname is not possible, because it may vary
so, e.g. if mode_spread = 5 and (ask-bid) = 0.5 the functions returns "2", so we have 2 decimal places behind the comma. It just looks at which place after the comma the integer value from mode_spread appears.
Code: Select all
if (StringFind(DoubleToStr((Ask-Bid),Digits),DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD),0),0)==2)
{
Print("RiskBased OrderSend script: Looks like the pair had 2 decimal places, ...");
multiplier=100; // for pairs with 2 decimal places, e.g. GOLD
}