Cóż, widziałem period_converter.mq4, który pochodzi z Metatrader 4. To, co chcę zrobić, aby zbudować pliki .hst dla mql4 indiorea. Pytanie brzmi teraz, jak mogę to zrobić dla więcej niż jednego przedziału czasowego?
Wypróbowałem to sam w łatwy sposób. Oto kod. To skrypt. Więc nie jestem pewien, czy przekonwertuję go do indioru (lub zapętlę to), jak „dopełnię” plik. Dołącza period_converter.mq4. Po prostu zobacz powyższe stwierdzenie dotyczące problemu z tym.
Wstawiony kod int start () {//---- Komentarz (Rozpoczęcie ......); int intTotalCount = 10; bool bolLoopFinished = false; int intHandle = FileOpen (myfile.csv, FILE_CSV | FILE_WRITE, ','); string strDate; FileWrite (intHandle, Date, Open, High, Low, Close); if (intHandlelt; 0) return (0); int intShiftLoop = 1, intShift = 0; while (! bolLoopFinished) {Comment (Loop:, intShiftLoop ,. Bars:, Bars); iBarShift (NULL, PERIOD_H1, Time # 91; intShiftLoop # 93;, true); intShiftLoop ; if (intShiftLoopgt; Bars) bolLoopFinished = true; } intShiftLoop = 1; intShift = 1; bolLoopFinished = false; while (! bolLoopFinished) {Komentarz (uzyskanie wartości historycznych ......); 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); Komentarz (Indior skończył);/---- return (0); }/ ---------------------------------------------- -------------------- ciąg 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); return (strReturnValue); }