Differences representing 3 or 5 decimals symbols New comment Webmeiker 2018.03.12 19:08 I am trying to export symbol rates to a CSV file using this code, that works fine for symbols that work with 3 decimals (like CADJPY), but not for those that work with 5 decimals (like AUDCAD): void OnStart() { string symbolName = Symbol(); //o _Symbol ENUM_TIMEFRAMES period = Period(); //o _Period string periodName = EnumToString(period); int decimals =(int)SymbolInfoInteger(symbolName, SYMBOL_DIGITS); string fileName = symbolName + "_" + periodName + ".csv"; int fileHandle = FileOpen(fileName, FILE_WRITE|FILE_CSV); if (fileHandle != INVALID_HANDLE) { MqlRates bars[]; ArraySetAsSeries(bars, true); int numBars = CopyRates(symbolName, period, 0, Bars(symbolName, period), bars); for (int i = 0; i < numBars; i++) { FileWrite(fileHandle, DoubleToString(NormalizeDouble(bars[i].open, decimals), decimals), DoubleToString(NormalizeDouble(bars[i].high, decimals), decimals), DoubleToString(NormalizeDouble(bars[i].low, decimals), decimals), DoubleToString(NormalizeDouble(bars[i].close, decimals), decimals) ); } FileClose(fileHandle); } } Any help will be appreciated, thanks! Code on 4 decimal price vs 5 decimal price Experts: 10 points on EURUSD & GBPUSD Trying to capture the current closed price Webmeiker 2018.03.13 14:22 #1 This is an Excel issue. If I open the CSV with a plain text editor I see it correctly New comment
I am trying to export symbol rates to a CSV file using this code, that works fine for symbols that work with 3 decimals (like CADJPY), but not for those that work with 5 decimals (like AUDCAD):
Any help will be appreciated, thanks!