作者ifoo (天空之城)
看板Option
標題[問題]請問HTS輸出下單訊號
時間Thu Jul 9 11:44:41 2009
我用五分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
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.164.73.156
※ 編輯: ifoo 來自: 218.164.73.156 (07/09 11:53)
1F:推 bhafnndpcst:當下的k線close價會一直變 07/09 13:21
2F:→ ifoo:但我加if date = lastcalcdate and time = LastCalcTime then 07/09 16:37
3F:→ ifoo:卻發揮不了作用?? 07/09 16:38
4F:→ krazymilk:看這些比看大盤還難懂 囧 07/09 17:26
5F:→ idleidle:最基本的程式交易,樓上加油! 07/09 18:05
※ 編輯: ifoo 來自: 218.164.73.156 (07/09 18:37)
6F:→ ifoo:有辦法把close改成bar結束的close嗎,讓穿越只會出現一次 07/09 18:55