想請問小編
有辦法寫出台指日盤的開收盤價及高低點 以及 台指夜盤的開收盤價及高低點 的程式碼嗎
Hello 股海茫茫,
您可以用變數來記錄相關數據。
舉例來說,使用在分鐘頻率上的話:
if time = 084500 then begin //用value1 和 value2 紀錄 早盤高低點
value1 = high;
value2 = low;
end;
if time > 084500 and time <= 134500 and value1 < high then value1 = high; //有更高更低的價格就更新value1和value2
if time > 084500 and time <= 134500 and value2 > low then value2 = high;
if time = 150000 then begin //用value1 和 value2 紀錄 夜盤高低點
value3 = high;
value4 = low;
end;
if (time > 150000 or time <= 050000) and value3 < high then value3 = high; //有更高更低的價格就更新value1和value2
if (time > 150000 or time <= 050000) and value4 > low then value4 = low;
這樣就可以分別找出早晚盤的高低點。
謝謝小編,不過我當初提問題的時候可能沒有題問很好,
我想問的是早盤台指開盤的時候可以標註前一個時段開盤的高低開收四個價位,也就是早盤的時候可以標註夜盤的,夜盤的時候標註早盤的
謝謝小編,使用上述程式碼,已自行改出我要的樣子了
3 評論