很久沒寫埸程式了,有bug不能解決,本來用布林值解設定收盤價在50MA之上買入策略才生效,但沒法啟動策略開關(失效),以致是否在50MA之上都啟動買入策略.從前一向都是這樣寫沒問題的?
var0 = AverageFC( close, Length1 ) ; { 50 MA }
if Close > var0 then
var3 = true
else if Close < var0 then
var3 = false ;
condition1 = var3 ;
condition2 = Close > var1 ;
if condition1 and condition2 then
Buy next bar at market ;
|