在圖表交易系統中--波段交易如何寫程序
作者:金字塔 來源:cxh99.com 發布時間:2016年11月29日
- 咨詢內容:
我的思路是這樣的:如果今天在盤中:實時價格大于昨天(最高價一最低價)那么就開盤做多;如果今天在盤中:實時價格小于昨天(最高價一最低價)那么就開盤做空;下午14點59分30秒全部清倉。請教高手寫個圖表交易系統的程序
- 金字塔客服:
我的思路是這樣的:如果今天在盤中:實時價格大于昨天(最高價一最低價)那么就以 開盤價加昨天(最高價一最低價)做為開盤做多;如果今天在盤中:實時價格小于昨天(最高價一最低價)那么就以 開盤價減昨天(最高價一最低價)做為開盤做空;下午14點59分30秒全部清倉。請教高手寫個圖表交易系統的程序
- 用戶回復:
如果今天在盤中:實時價格大于昨天(最高價一最低價)那么就開盤做多;
如果今天在盤中:實時價格小于昨天(最高價一最低價)那么就開盤做空;
下午14點59分30秒全部清倉。
h1:callstock(stklabel,vthigh,6,-1);
l1:callstock(stklabel,vtlow,6,-1);
if h>(h1-l1) then begin
sellshort(1,0,market);
buy(holding=0,1,market);
end
if l<(h1-l1) then begin
sell(1,0,market);
buyshort(holding=0,1,market);
end
if (currenttime>=145930 and islastbar) or(time=closetime(0) and not(islastbar)) then begin
sell(1,0,market);
sellshort(1,0,market);
end