個股儀表板

  •   256 
  • 最後發表   superlin  2018 十一月 16
superlin 發文於   2018/10/28

//========DIF-MACD翻正=============

input: FastLength(12), SlowLength(26), MACDLength(9);

variable: difValue(0), macdValue(0), oscValue(0);

MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue);

var:c6(0);

c6=   barslast  (oscValue Crosses Above 0);

if c6=0 and c6[1]>20

then condition6=true;

if condition6

then plot6(value5,"DIF-MACD翻正");

 

 

請問我要它有出現就顯示  - 而不是取得上一次條件成立到當前的K棒數

回傳數值=BarsLast(條件數列)     請問要換成 哪種函數  謝謝

排序方式: 標準 | 最新
superlin 發文於   2018/10/29

就是有訊號就顯示  標識

 

c6=   barslast  (oscValue Crosses Above 0);

if c6=0 and c6[1]>20 請問  C6 這什麼說明

XQ小幫手 發文於   2018/10/29

Hi superlin

您好,

請問我要它有出現就顯示  - 而不是取得上一次條件成立到當前的K棒數

猜想它有就出現的意思是為,只要 oscValue Crosses Above 0 就顯示 plot6(value5,"DIF-MACD翻正");

若是的話,改寫成 if oscValue Crosses Above 0 then plot6(value5,"DIF-MACD翻正") else noplot(6);

以上方向供參考,謝謝。


 

...請問  C6 這什麼說明

以下此篇文章有說明,提供給您參考,謝謝。

個股儀表板step by step 節錄部分說明如下:

這個程式它的步驟有幾個

一,把每一個進場標準都視為一個condition,有多少個標準就設多少個,每一個condition的default值都是false。

二,依不同價位設置進場點的標示位置,

三,開始根據進場標準,在condition從false變成true時把進場標示標在當根K棒的底下,用Barslast來過濾同一個訊號必須是20天來第一次出現的

superlin 發文於   2018/11/15

c6= barslast (oscValue Crosses Above 0);

if c6=0 and c6[1]>20

請問如果我不要20天以來出現的

只要符合就出現 請問要怎麼改  謝謝

XQ小幫手 發文於   2018/11/16

Hi superlin,

您好,

c6= barslast (oscValue Crosses Above 0);

if c6=0 and c6[1]>20

請問如果我不要20天以來出現的

只要符合就出現 請問要怎麼改  謝謝

若僅有此段程式碼,而想秀出線圖,可以使用 2018/10/29 小幫手回覆的方式,

改寫成 if oscValue Crosses Above 0 then plot6(value5,"DIF-MACD翻正") else noplot(6);

 

完整程式碼範例如下,以上方向供您參考,謝謝:

//========DIF-MACD翻正=============

input: FastLength(12), SlowLength(26), MACDLength(9);

variable: difValue(0), macdValue(0), oscValue(0);

MACD(weightedclose(), FastLength, SlowLength, MACDLength, difValue, macdValue, oscValue);

var:c6(0);

{c6=   barslast  (oscValue Crosses Above 0);

if c6=0 and c6[1]>20

then condition6=true;

if condition6

then plot6(value5,"DIF-MACD翻正");}

if oscValue Crosses Above 0 then plot6(true,"DIF-MACD翻正") else noplot(6);

 

繪圖設定如下:

 

發表回覆
Close