相關標簽:
程序原理,基于OBV指標,使用唐安奇通道,OBV大于30個周期最大值做多,小于30個周期最小值做空
模型策略源碼://股指期貨自動交易程序(7分鐘日內OBV交易系統) //編制: //日期: { //加密及期限 drawtextex(1,1,200,800,engincode()); rzb:=strcmp(engincode(),\'aaaaaaaaaa\'); if rzb<>0 then begin drawtextex(1,1,500,500,\'程序不能在此計算機上運行\'); exit; end 有效期:1121230,linethick0; 賬號:11111,linethick0; zhh:=strtonum(taccount(1)); if zhh<>賬號 then begin drawtextex(1,1,500,500,\'授權賬號不正確,程序無法使用\'); exit; end if date>有效期 then begin drawtextex(1,1,500,500,\'已過授權時間,程序無法使用\'); exit; end if datatype<>17 then begin drawtextex(1,1,50,950,\'本程序使用3分鐘周期,請切換到3分鐘周期\'); exit; end } //======================================================== //交易控制變量 www.kzuj.com.cn //********************************** //交易手數: tn:=1; //最大持倉量 cx:=1; //提前下單量(秒)www.kzuj.com.cn xd:=3; //交易時間區間 p1:=time>091800 and time<150000; p2:=if(islastbar,dynainfo(207),time); p3:=time0-timetot0(p2),linethick0; //******************************** r1:=barslast(date<>ref(date,1)); r2:=ref(o,r1+1); //******************************** hd:=if(islastbar,3,1);//即時下單加1點的滑點; hd1:=if(islastbar,3,0.2);//k線走完提前3秒下單加0.2點的滑點; //******************************** robv:=sum(if(close>ref(close,1),vol,if(close<ref(close,1),-vol,0)),0); //******************************** rh:=ref(hhv(robv,n1),1); rl:=ref(llv(robv,n1),1); //******************************** if robv>rh and p1 then begin sellshort(holding<0,0,thisclose); buy(holding=0,tn,thisclose); end if robv<rl and p1 then begin sell(holding<0,0,thisclose); buyshort(holding=0,tn,thisclose); end //*************************** if holding>0 and c<enterprice-3 and p1 then begin buy(holding<cx,tn,thisclose); end if holding<0 and c>enterprice+3 and p1 then begin buyshort(abs(holding)<cx,tn,thisclose); end //收盤前清倉 www.kzuj.com.cn if p2>=151200 then begin sellshort(holding<0,0,limitr,c+hd1); sell(holding>0,0,limitr,c-hd1); end //************************************* 交易總數:totaltrade,colorwhite,linethick0; 盈虧:asset-1000000,colorred,linethick1,noaxis; 日盈虧:asset-ref(asset,r1+1),noaxis,colorred,linethick0; 持倉:holding,colorwhite,linethick0; 點擊復制上述代碼粘貼到到公式管理器
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}