在過去的特定一段時間畫水平線

  •   84 
  • 最後發表   mikeyang0215  2026 七月 30
mikeyang0215 發文於   2026/07/29

你好,我想做到在前一天的台指期日夜盤劃一條水平線(例如今天是7/29, 我想在 7/28 15:00 ~ 7/29 05:00 劃一條在 40600位置的水平線,這有辦法做到嗎? (在 7/29 08:45 之後就不顯示出來)

排序方式: 標準 | 最新
虎科大許教授 發文於   2026/07/29

可以用PlotLine處理。記錄開始及結束K棒的編號即可完成任務。

mikeyang0215 發文於   2026/07/29

請問許教授,該如何知道K棒的編號?

虎科大許教授 發文於   2026/07/30

currentBar會傳回K棒的編號。繪圖樣式的型式設定為線段。

//繪圖樣式的型式:線段
if barFreq<>"Min" then raiseRunTimeError("限用分鐘頻率");
if date=dateAdd(currentDate,"D",-1) and time=150000 then value1=currentBar;
if date=currentDate and time=084500 then value2=currentBar-1;
plotLine(1,value1,40600,value2,40600);
if date=currentDate then noplot(1);

發表回覆
Close