畫線無法往右延伸過去

  •   190 
  • 最後發表   Meow meow  2022 十月 21
Meow meow 發文於   2022/10/20

Hi 小幫手您好,

     我要在當根K棒畫一條橫線往右延伸,不管繪圖樣式怎麼改,都是只出現在當根K棒,有何地方錯誤,煩請指正,謝謝!

 

排序方式: 標準 | 最新
XQ小幫手 發文於   2022/10/20

Hello Meow meow,

 

if volume > value2 and volume > volume[1] * 1.5 thne plot1(high, "過高");

您的這種寫法會讓plot只畫在條件符合的地方。

如果是要條件符合後都畫出來的話,應該這樣寫:

var: intrabarpersist _cond(0);

if date <> date[1] then _cond = 0;

if volume > value2 and volume > volume[1] * 1.5 then _cond = 1;

if _cond = 1 then plot1(high, "過高");

這樣 _cond 在條件達到後就會一直是 True,除非換日時才會重置。

Meow meow 發文於   2022/10/20

Hi 小幫手,

 

      收到,感謝!!

Meow meow 發文於   2022/10/20

照著改,只有當根K棒有,沒有連續水平線? 請再提供,謝謝!

musashi 發文於   2022/10/20

是不是這樣呢?

var: intrabarpersist _cond(0);
if date <> date[1] then _cond = 0;
if volume > value2 and volume > volume[1] * 1.5 then _cond = high;
plot1(_cond, "過高");

Meow meow 發文於   2022/10/21

Hi 小幫手,

     謝謝,晚上10點多還回覆,非常感謝,可以用了,沒問題。

XQ小幫手 發文於   2022/10/21

Hello Meow meow,

 

您只需要用變數紀錄條件符合當下的 high 即可,可參考 musashi 提供的作法。

 

感謝 musashi 的熱心回覆。

Meow meow 發文於   2022/10/21

Hi Musashi,

   非常感謝您的幫忙!!

 

發表回覆
Close