very short historical datas available from mq4?

 

hi!

my little script should write the macd indicator and the candles's values.

for gbp/usd i can write onto a file 50023 minutes, but eur/usd not.

after 2418 minutes the macd + signal are 0.

after 29214 minutes all values are 0.

my script is 



int start() {
static int flag;
int handle;

double EURUSD_M1_MACD_1;
double EURUSD_M1_MACD_2;
handle=FileOpen("MACDA.csv", FILE_CSV|FILE_WRITE, ',');
if(handle>0){
for (int i = 0; i<53050; i++) {
EURUSD_M1_MACD_1= iMACD("EURUSD",0,1,2,3,PRICE_MEDIAN,MODE_MAIN,i);
EURUSD_M1_MACD_2= iMACD("EURUSD",0,1,2,3,PRICE_MEDIAN,MODE_SIGNAL,i);
FileWrite(handle, iTime("EURUSD",PERIOD_M1,i), DoubleToStr(EURUSD_M1_MACD_1,4),DoubleToStr(EURUSD_M1_MACD_2,4),
iOpen("EURUSD",PERIOD_M1,i),
iHigh("EURUSD",PERIOD_M1,i),
iLow("EURUSD",PERIOD_M1,i),
iClose("EURUSD",PERIOD_M1,i),
iVolume("EURUSD",PERIOD_M1,i));
}
FileClose(handle);
}
return(0);
}

for gbpusd everything are same, just the pair is different.

mega thx for every answer:)

cheers

M

 
meta:

hi!

my little script should write the macd indicator and the candles's values.

for gbp/usd i can write onto a file 50023 minutes, but eur/usd not.

after 2418 minutes the macd + signal are 0.

after 29214 minutes all values are 0.

my script is



int start() {
static int flag;
int handle;

double EURUSD_M1_MACD_1;
double EURUSD_M1_MACD_2;
handle=FileOpen("MACDA.csv", FILE_CSV|FILE_WRITE, ',');
if(handle>0){
for (int i = 0; i<53050; i++) {
EURUSD_M1_MACD_1= iMACD("EURUSD",0,1,2,3,PRICE_MEDIAN,MODE_MAIN,i);
EURUSD_M1_MACD_2= iMACD("EURUSD",0,1,2,3,PRICE_MEDIAN,MODE_SIGNAL,i);
FileWrite(handle, iTime("EURUSD",PERIOD_M1,i), DoubleToStr(EURUSD_M1_MACD_1,4),DoubleToStr(EURUSD_M1_MACD_2,4),
iOpen("EURUSD",PERIOD_M1,i),
iHigh("EURUSD",PERIOD_M1,i),
iLow("EURUSD",PERIOD_M1,i),
iClose("EURUSD",PERIOD_M1,i),
iVolume("EURUSD",PERIOD_M1,i));
}
FileClose(handle);
}
return(0);
}

for gbpusd everything are same, just the pair is different.

mega thx for every answer:)

cheers

M


Go to History centre, select EUR/USD pair and download 1M history data from MetaQuotes. Just remember MetaQuotes data is GMT+1, you may need to massage the data if your broker is not GMT+1.

 
migmof:

Go to History centre, select EUR/USD pair and download 1M history data from MetaQuotes. Just remember MetaQuotes data is GMT+1, you may need to massage the data if your broker is not GMT+1.

Hi Migmof!

Thank you, but i would like to calculate the exact MACD values too, and dont understand why does it work with gbpusd for 50000 values and much more fewer for eurusd?

thx,

M

Reason: