條件1與條件2同時滿足,才跳出警示通知(策略雷達)

請問腳本這樣寫,可以嗎

謝謝

 

 

 

 

 

 

SetTotalBar(80);

var: maValue(0), isMatch(false);

maValue = Average(Close, 60);

if Close[1] < maValue[1] and Close > maValue then 

    isMatch = true 

else 

    isMatch = false;

 

if isMatch = true then 

begin

    ret = 1;

    retmsg = "60分K棒收盤站上60SMA!當前價:" + NumToStr(Close, 2) + ",均線價:" + NumToStr(maValue, 2);

end;