akibasoma 發表於 21-8-30 21:29

均線策略,求解答

我想寫在XAverage(close,144),XAverage(close,169),XAverage(close,288),XAverage(close,388)的均線以上用XAverage(close,5)cross over XAverage(close,20)作多,XAverage(close,5) cross below XAverage(close,20)平倉不作多都失敗,求幫忙
ifXAverage(close,144)>XAverage(close,144)
and XAverage(close,169)>XAverage(close,169)and XAverage(close,288)>XAverage(close,288)
and XAverage(close,388)>XAverage(close,388)
//and XAverage(close,5)cross over XAverage(close,20)
and close>XAverage(close,20)
then begin buy("B+") next bar at market;


ifXAverage(close,144)>XAverage(close,144)
    and XAverage(close,169)>XAverage(close,169)and XAverage(close,288)>XAverage(close,288)
    and XAverage(close,388)>XAverage(close,388)
    //and XAverage(close,5) cross below XAverage(close,20)
    and close<XAverage(close,20)
    then sell("B-") next bar at market;

END;



zegawong 發表於 21-9-2 16:15

XAverage(close,5) > XAverage(close,144) and
XAverage(close,5) > XAverage(close,169) and ......
                        ...........
XAverage(close,5) cross over XAverage(close,20)
then buy("B+") next bar at market;

大概是這樣吧~~ 請試一試

zegawong 發表於 21-8-31 08:52

XAverage(close,144)>XAverage(close,144)

這是同一條線, 所以條件永遠不會成立

akibasoma 發表於 21-9-1 22:03

感謝大大,可以教我寫一下嗎?

akibasoma 發表於 21-9-4 15:24

感謝,大大,可以了,
頁: [1]
查看完整版本: 均線策略,求解答