下記の関数をそれぞれmql4とmql5のOnInit()にいれて実行したのですが、mql4は問題なくスクリーンショットが取れて、mql5はpngファイルが出力されていますが、中身は真っ白な画像です。コンパイルエラーは両方ともなしです。ChartScreenShotの返却値は両方ともtrueです。違いが生じる原因はなんでしょうか?
input int Width = 800; //画像幅
input int Height = 600; //画像高さ
// スクリーンショット取得
void tackPickture() {
Print("呼ばれる!!!!!!!!!!!!!!!!");
MqlDateTime current;
TimeToStruct(TimeCurrent(), current);
// yyyyMMdd_HHmmss形式に変換
string timestr = StringFormat("%04d%02d%02d_%02d%02d%02d", current.year, current.mon,
current.day, current.hour, current.min, current.sec);
string period_s = PeriodToString(Period());
string name = Symbol() + "_" + period_s + "_" + timestr;
//保存フォルダ 日毎に分ける
string folder = StringFormat("%04d%02d%02d\\", current.year, current.mon, current.day);
//ファイルはMQL4\Files\以下に保存される
bool check = ChartScreenShot(0, folder + name + ".png", Width, Height, ALIGN_LEFT);
if(check){
Print("cap成功");
}else{
Print("cap失敗");
}
}