double pipValue = 10.0;
if(StringFind(Symbol(), "XA") >= 0) {
// it is gold or metal
pipValue = 1.0;
}
The pip value will vary according with digits of the broker. For example, Dukascopy has XAUUSD with 3 digits instead of 2 digits. So, The pipvalue multiplier for dukascopy is wrong for XAUUSD. The logic of the code above will set the pipvalue equal 1, but for dukascopy the right pipvalue is 10 due third digit.
double pipValue = 10.0;
if(Digits == 4 || Digits == 2)
//Symbols with 4 digits (4 digits brokers) and 2 digits (GOLD and JPY 2 digits brokers) will multiplied by 1
pipValue = 1.0;
(MarketInfo(Symbol(),MODE_TICKVALUE)*MarketInfo(Symbol(),MODE_POINT)) / MarketInfo(Symbol(),MODE_TICKSIZE);
// adjust money management for non-US currencies
double CurrencyAdjuster=1;
if (MarketInfo(Symbol(),MODE_TICKSIZE)!=0) CurrencyAdjuster=MarketInfo(Symbol(),MODE_TICKVALUE) * (MarketInfo(Symbol(),MODE_POINT) / MarketInfo(Symbol(),MODE_TICKSIZE));
Status changed from New to Fixed