好吧,我已經看到Metatrader 4附帶的period_converter.mq4。這就是我想要為mql4 indiorea構建.hst文件。現在的問題是,我怎樣才能讓它超過一個時間框架呢?
我以一種簡單的方式自己嘗試過這個。這是代碼。這是一個腳本。所以我不確定我是否將它轉換為indior(或循環這個)我將如何'追加'.hst文件。 period_converter.mq4追加。請看上面關於那個問題的陳述。
Inserted Code int start(){//---- Comment(Starting ......); int intTotalCount = 10; bool bolLoopFinished = false; int intHandle = FileOpen(myfile.csv,FILE_CSV | FILE_WRITE,','); string strDate; FILEWRITE(intHandle,日期,開盤價,最高價,最低價,收市價); if(intHandlelt; 0)返回(0); int intShiftLoop = 1,intShift = 0; while(!bolLoopFinished){Comment(Loop:,intShiftLoop,。Bars :, Bars); iBarShift(NULL,PERIOD_H1,時間#91;#intShiftLoop 93;,TRUE); intShiftLoop ; if(intShiftLoopgt; Bars)bolLoopFinished = true; } intShiftLoop = 1; intShift = 1; bolLoopFinished = FALSE; while(!bolLoopFinished){評論(凝聚歷史價值......); strDate = funcBuildDate(ITIME(NULL,PERIOD_H1,intShift)); FileWrite(intHandle,strDate,iOpen(NULL,PERIOD_H1,intShift),iHigh(NULL,PERIOD_H1,intShift),iLow(NULL,PERIOD_H1,intShift),iClose(NULL,PERIOD_H1,intShift)); intShift ; if(intShiftgt; 10)bolLoopFinished = true; } FileClose(intHandle);評論(Indior完成);/---- return(0); }/ ---------------------------------------------- -------------------- string funcBuildDate(datetime dtTime){//YYYY.MM.DD HH:MM:SS int intYear = TimeYear(dtTime); int intMonth = TimeMonth(dtTime); int intDay = TimeDay(dtTime); int intHour = TimeHour(dtTime); int intMinute = TimeMinute(dtTime); int intSeconds = TimeSeconds(dtTime); string strReturnValue = StringConenate(intYear,。,intMonth,。,intDay ,, intHour,:,intMinute,:,intSeconds);返回(strReturnValue); }