Hi,
I have a problem opening 96 charts at the same time with ChartOpen function of Metatrader.
Maybe someone can suggest a solution.
I try to open 96 Charts (12 pairs with 8 TimeFrames). with ChartOpen(), then take ChartScreenShot's.
But if ChartOpen fails once (with returning zero and with internal error no 4024),
it not possible to re-open same symbol with ChartOpen.
If you know a solution to guarantee to open all 12 symbols with 8 time frames appreciated.
Below I paste the problem. Forexample: if ChartOpen("EURUSD",5) fails ,it always fails in next tries.
The symbol is random, 4-5 charts in 96 can not be opened for unknown error.
(Strangely, charts are opened allthough return is false.)
int PTimeFrame[]={1,5,15,30,60,240,1440,10080};
string parite[] = {"EURUSD","GBPUSD","USDJPY","USDCHF ","AUDUSD","USDCAD", "EURGBP","EURJPY","GBPJPY","AUDJPY" ,"XAGUSD", "XAUUSD"};
allcharts[12][8]; // Initialized to Zero.
//... below code in OnTick.
for(int k=0;k<12;k++){ //12
for(int pp=0;pp<8;pp++){//8
if(allcharts[k][pp]==0) //open the chart, if it is not alrady open.
{
allcharts[k][pp]=ChartOpen(parite[k],PTimeFrame[pp]); // --> Here if fails once , it always fails on next tries for some symbols.
if(chartid!=0){
ChartScaleSet(3,chartid);
ChartAutoscrollSet(true,chartid);
ChartModeSet(CHART_CANDLES,chartid) ;
}
}
}
I have a problem opening 96 charts at the same time with ChartOpen function of Metatrader.
Maybe someone can suggest a solution.
I try to open 96 Charts (12 pairs with 8 TimeFrames). with ChartOpen(), then take ChartScreenShot's.
But if ChartOpen fails once (with returning zero and with internal error no 4024),
it not possible to re-open same symbol with ChartOpen.
If you know a solution to guarantee to open all 12 symbols with 8 time frames appreciated.
Below I paste the problem. Forexample: if ChartOpen("EURUSD",5) fails ,it always fails in next tries.
The symbol is random, 4-5 charts in 96 can not be opened for unknown error.
(Strangely, charts are opened allthough return is false.)
int PTimeFrame[]={1,5,15,30,60,240,1440,10080};
string parite[] = {"EURUSD","GBPUSD","USDJPY","USDCHF ","AUDUSD","USDCAD", "EURGBP","EURJPY","GBPJPY","AUDJPY" ,"XAGUSD", "XAUUSD"};
allcharts[12][8]; // Initialized to Zero.
//... below code in OnTick.
for(int k=0;k<12;k++){ //12
for(int pp=0;pp<8;pp++){//8
if(allcharts[k][pp]==0) //open the chart, if it is not alrady open.
{
allcharts[k][pp]=ChartOpen(parite[k],PTimeFrame[pp]); // --> Here if fails once , it always fails on next tries for some symbols.
if(chartid!=0){
ChartScaleSet(3,chartid);
ChartAutoscrollSet(true,chartid);
ChartModeSet(CHART_CANDLES,chartid) ;
}
}
}