有請老師幫編寫個策略
作者:金字塔 來源:cxh99.com 發布時間:2014年02月01日
- 咨詢內容:
有請老師幫編寫個模型:當天的漲幅超過1%就買入開倉,跌幅超過1%就賣出開倉,是指令價達到1%就開倉,不用等收盤價,到14.55就平倉怎么編寫?
- 金字塔客服:
漲幅跌幅如何定義?
(最高價-當日開盤)/當日開盤?
[此貼子已經被作者于2013/12/25 15:10:07編輯過]
- 用戶回復:
最新價比昨天收盤價>1%
- 網友回復:
zuoshou:ref(close,todaybar);
if (h-zuoshou)/zuoshou>=0.01 then buy(holding=0,1,market);
if (l-zuoshou)/l<=-0.01 then buyshort(holding=0,1,market);
if time>=145500 then begin
sellshort(1,0,market);
sell(1,0,market);
end
- 網友回復:
怎么快收盤的時候又開倉?