多次到頂而破

  •   177 
  • 最後發表   肉粽  2021 十一月 12
肉粽 發文於   2021/11/10

input:hittimes(3);  setInputName(1,"設定觸頂次數");

input:rangeratio(1); setInputName(2,"設定頭部區範圍寬度");

input:length(20);    setInputName(3,"計算期數");

variable: thehigh(0); thehigh=highest(high[1],length); //找到過去期間的最高點

variable:highlowerbound(0); highlowerbound=thehigh*(100-rangeratio)/100;  //設為瓶頸區間上界

variable:touchrangtimes(0);  //期間中進入瓶頸區間的低點次數,每根K棒要歸0

 

//回算在此區間中 進入瓶頸區間的次數

touchrangtimes =countIf(high[1] >highlowerbound,length);

 

if touchrangtimes>=hittimes  and (q ask > thehigh or close>thehigh) then ret=1;

排序方式: 標準 | 最新
肉粽 發文於   2021/11/10

依照李政霖總經理的第五堂課投影片內容為何無法編譯

if touchrangtimes>=hittimes  and (q ask > thehigh or close>thehigh) then ret=1;

問題不知道出在哪?請高手指點,謝謝

XQ小幫手 發文於   2021/11/11

Hello 肉粽,

 

正確寫法應該是 if touchrangtimes>=hittimes  and (q_ask > thehigh or close>thehigh) then ret=1;

q和ask之間有下底線。

肉粽 發文於   2021/11/12

謝謝提醒語回答感恩高手

 

發表回覆
Close