請問如何寫有特定開市時段的10天頂/底?
各位師兄,小弟想寫香港期指的日線圖5天最高/位,然後放於5分鐘圖運用TimeFrameSet(inDaily);
FiveDayH = HHV(High, 5);
FiveDayL = LLV(Low, 5);
TimeFrameRestore();
FiveDayH = TimeFrameExpand(FiveDayH, inDaily);
FiveDayL = TimeFrameExpand(FiveDayL, inDaily);
Plot(FiveDayH,"Five Days High",colorOrange,styleLine|styleThick);
Plot(FiveDayL,"Five Days Low",colorAqua,styleLine|styleThick);
如果只寫5天,小弟自己寫了這個以乎都可以,但香港期指開市時間由早上9:15至翌日凌晨3時,我想嘗試把時間放進去,卻寫不出來,請各位師點
//Tradingtimeset
tn1 = TimeNum();
startTime = 091400;
endTime = 270000;
Tradingtime = tn1 >= startTime AND tn1 <= endTime;
//5DaysHigh & Low
TimeFrameSet(inDaily);
DayTwo = Ref(Tradingtime, -1);
DayThree = Ref(Tradingtime,-2);
DayFour = Ref(Tradingtime,-3);
DayFive = Ref(Tradingtime,-4);
DaySix = Ref(Tradingtime,-5);
FiveDays = DayTwo AND DayThree AND DayFour AND DayFive;
FiveDayH = Ref(High, FiveDays);
FiveDayL = Ref(Low, FiveDays);
TimeFrameRestore();
FiveDayH = TimeFrameExpand(FiveDayH, inDaily);
FiveDayL = TimeFrameExpand(FiveDayL, inDaily);
Plot(FiveDayH,"Five Days High",colorOrange,styleLine|styleThick);
Plot(FiveDayL,"Five Days Low",colorAqua,styleLine|styleThick);
endTime = 270000;
if (tn < 90000) tn += 240000;// 加入這一行
Tradingtime = tn1 >= startTime AND tn1 <= endTime;
頁:
[1]