if anyone has a spare minute and a better grip on mt5 and its c++... hoping there is a simple answer?
yesterdays session threw up a strange anomaly.... the M5 0915 and M10 0910 GBPUSD charts both close at the same time and the chart reads 1.29797 as its closing price but the internal representation in my code (taken from the mt4 library conversion back when c++ invaded) has it at a value of 1.29879 which is the close of the 0918 m1 candle...
the 0910 M10 candle is clearly not bullish thrust closing (closing near the high)... but can anyone give me an idea of why the value the internal representation is getting is different than the chart... Ive never noticed this before yesterday... as the code has been pretty robust...
any ideas will be very much appreciated?
the code snippet i use is below...
#define MODE_CLOSE 3
double Close[]
//+------------------------------------------------------------------+
//| iClose
//+------------------------------------------------------------------+
double iClose(int bar)
{
if(bar<0) return(-1);
double array[];
if(CopyClose(_Symbol,_Period,bar,1,array)>0)
return(array[0]);
else
return(-1);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double iClose(string symbol,ENUM_TIMEFRAMES timeframe,int bar)
{
if(bar<0) return(-1);
double array[];
if(CopyClose(symbol,timeframe,bar,1,array)>0)
return(array[0]);
else
return(-1);
}
and then i reference it in the old standard mt4 manner
X =iClose(Symbol(),PERIOD_M10,0);
yesterdays session threw up a strange anomaly.... the M5 0915 and M10 0910 GBPUSD charts both close at the same time and the chart reads 1.29797 as its closing price but the internal representation in my code (taken from the mt4 library conversion back when c++ invaded) has it at a value of 1.29879 which is the close of the 0918 m1 candle...
the 0910 M10 candle is clearly not bullish thrust closing (closing near the high)... but can anyone give me an idea of why the value the internal representation is getting is different than the chart... Ive never noticed this before yesterday... as the code has been pretty robust...
any ideas will be very much appreciated?
the code snippet i use is below...
#define MODE_CLOSE 3
double Close[]
//+------------------------------------------------------------------+
//| iClose
//+------------------------------------------------------------------+
double iClose(int bar)
{
if(bar<0) return(-1);
double array[];
if(CopyClose(_Symbol,_Period,bar,1,array)>0)
return(array[0]);
else
return(-1);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double iClose(string symbol,ENUM_TIMEFRAMES timeframe,int bar)
{
if(bar<0) return(-1);
double array[];
if(CopyClose(symbol,timeframe,bar,1,array)>0)
return(array[0]);
else
return(-1);
}
and then i reference it in the old standard mt4 manner
X =iClose(Symbol(),PERIOD_M10,0);