小編您好
我想撰寫月K情況下,當期月K的紅K吞噬上一期的黑K (上一期一定是黑K),寫出來的語法如下,但篩選出來與想像中不同,再麻煩解惑,謝謝
condition1 = getfield("open", "M")[1] > getfield("Close", "M")[1];
condition2 = getfield("close", "M")[0] > getfield("open", "M")[1];
If condition1 and condition2 then
ret=1;
小編您好
我想撰寫月K情況下,當期月K的紅K吞噬上一期的黑K (上一期一定是黑K),寫出來的語法如下,但篩選出來與想像中不同,再麻煩解惑,謝謝
condition1 = getfield("open", "M")[1] > getfield("Close", "M")[1];
condition2 = getfield("close", "M")[0] > getfield("open", "M")[1];
If condition1 and condition2 then
ret=1;
Hello 努力學習KKK,
網站上有教學區,裡面有XS語法的基礎和應用可以閱覽。
吞噬小幫手的理解為後面的實體紅Bar要包覆前面的實體黑Bar,那麼您需要將前面是黑Bar這點也寫在條件裡。
可以簡單將條件整理為:
condition1 = getfield("open", "M")[1] > getfield("close", "M")[1]; //前一根黑棒
condition2 = getfield("close", "M") > getfield("open", "M")[1]; //當根收盤價大於前一根開盤價
condition3 = getfield("open", "M") < getfield("close", "M")[1]; //當根開盤價小於前一根收盤價
if condition1 and condition2 and condition3 then ret = 1;
1 評論