ShortMA=Average(Close[1], ShortMA_Period);
LongMA=Average(GetField("Close","60")[1],LongMA_Period);
CrossUp=((Close[1] cross over ShortMA) or (Close[1] cross over LongMA)) and (Close[1]>ShortMA) and (Close[1]>LongMA);
CrossDown=((Close[1] cross under ShortMA) or (Close[1] cross under LongMA)) and (Close[1]<ShortMA) and (Close[1]<LongMA);
bClosePosition = (Close[1]>ShortMA and Close[1]<LongMA) or (Close[1]<ShortMA and Close[1]>LongMA);
Print(Close[1],ShortMA,LongMA,CrossUp,CrossDown,Filled,bClosePosition);
Print((Close[1] cross over ShortMA),(Close[1] cross over LongMA),(Close[1]>ShortMA),(Close[1]>LongMA),(Close[1] cross under ShortMA),(Close[1] cross under LongMA));
5分K,印出來的結果如下,為什麼croee over不是True(橘色第一個應該為TRUE才是)? 請問,我的語法哪裡錯了? 請大神指導


3 評論