請教各位if出現K線A然後下條K線是B then 買入的寫法
各位大大,想請教if出現K線A然後下條K線是Bthen 買入的寫法請善用
ex1:
c ==> 表示2根K棒前的收盤價
ex2:(以空頭吞噬為例)
if c<o and c>o and
(o>=c and c<o) or (o>c and c<=o) then
sell next bar market; 如果第一根K線是if sgb and close>0 thenplotpb(h,l,"x",rgb(153,153,153))然後下一根K線是if sgb and close>1 thenplotpb(h,l,"x",rgb(153,153,153))應該怎樣寫
假設是要根據 Close > n 的方式來畫 K棒,由於先使用了 Close > 0 , 因此下一根 Close > 1 的條件都不會被執行, 可以改成
if sgb then begin
ifclose > 1then plotpb(h,l,"x",rgb(153,153,153)){ 處理大於 1的狀況 }
else if close > 0 then plotpb(h,l,"x",rgb(153,153,153)); { 處理 0~ 1 間的狀況 }
end ; 因為用了太多THEN,所以最後想請問怎樣加THEN BUY("BUY") next bar at market;?
var:conditionA(false),conditionB(false);
conditionA=close>close;
conditionB=close>close;
if conditionA and conditionB then
buy next bar at market;
把plotpb這裡換成買賣指令即可 如果第一根K線是if sgbthenplotpb(h,l,"x",rgb(153,153,153))然後下一根K線是if sgcthenplotpb(h,l,"x",rgb(153,153,153))應該怎樣寫
頁:
[1]