[問題]請問HTS輸出下單訊號

看板Option (期貨與選擇權)作者 (天空之城)時間16年前 (2009/07/09 11:44), 編輯推噓1(105)
留言6則, 4人參與, 最新討論串1/2 (看更多)
我用五分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)

07/09 13:21, , 1F
當下的k線close價會一直變
07/09 13:21, 1F

07/09 16:37, , 2F
但我加if date = lastcalcdate and time = LastCalcTime then
07/09 16:37, 2F

07/09 16:38, , 3F
卻發揮不了作用??
07/09 16:38, 3F

07/09 17:26, , 4F
看這些比看大盤還難懂 囧
07/09 17:26, 4F

07/09 18:05, , 5F
最基本的程式交易,樓上加油!
07/09 18:05, 5F
※ 編輯: ifoo 來自: 218.164.73.156 (07/09 18:37)

07/09 18:55, , 6F
有辦法把close改成bar結束的close嗎,讓穿越只會出現一次
07/09 18:55, 6F
文章代碼(AID): #1ALMUgJq (Option)
討論串 (同標題文章)
文章代碼(AID): #1ALMUgJq (Option)