我用五分K測試輸出下單訊號
K線收盤價大於3均線買進,反之賣出
為何我的下單訊號會一直重複輸出呢
而且買賣也不對
我找好久,程式看起來沒問題啊
有沒有高手可以幫我看一下
謝謝!!
Param : MA(3)
condition1=close cross over average(close,MA)
condition2=close cross below average(close,MA)
if condition1 then buy("buy") next bar at market
if date = lastcalcdate and time = LastCalcTime then
FileAppend("C:\order.txt", NumToStr(Q_Time,0) + "XXXX1XXXX" + "|r|n")
end if
end if
if condition2 then sell("sell") next bar at market
if date = lastcalcdate and time = LastCalcTime then
FileAppend("C:\order.txt", NumToStr(Q_Time,0) + "XXXX-1XXXX" + "|r|n")
end if
end if
All Comments