找出一個大量的plot指標 卻在半夜12點到凌晨收盤 沒辦法持續一直線

  •   52 
  • 最後發表   傑尼遇見你  2025 八月 15
傑尼遇見你 發文於   2025/08/12

 

程式碼如下 想問一下怎麼改可以讓plot持續一直線到隔天

 

var: _top(0), _botton(0), _avg(0), _bars(0);

 

_bars = getbaroffset(Date,084500)+1;

 

if _bars = 1 then begin

    _top = H;

    _botton = L;

   end

else

   begin

     if volume = highest(volume, _bars) then begin

       _top = H;

       _botton = L;

     end;

end;

 

_avg=getfield("均價");

 

Value1=(_top+_botton)/2;

 

plot1(_top,"爆量高點");

plot2(_botton,"爆量低點");

plot3(_avg,"均價線");

plot4(Value1,"爆量中線");

 

附加文件

排序方式: 標準 | 最新
虎科大許教授 發文於   2025/08/13

if currentTime>=084500 and currentTime<134500 then
_bars = getbaroffset(date,084500)+1
else _bars = getbaroffset(GetFieldDate("日期", "D"),150000)+1;

傑尼遇見你 發文於   2025/08/13

 謝謝教授,我來修改一下

XS小編 發文於   2025/08/15

Hello 傑尼遇見你,

 

小編補充,您執行的商品應該是有包含夜盤,請注意 date 會隨著實際時間而變動 (過了晚上12點數值會改變)。

GetFieldDate("Date", "D") 則是依據商品換日的規則,在夜盤開盤時就會變動 (過了 13:45 數值會改變)。

您可以將其畫在線圖上,會比較容易理解。

發表回覆
Close