期貨期權交流誰能幫我優化一下參數?[MC公式]
相關標簽:期貨與期權套利策略 、 期貨期權組合策略 、 期權與期貨的區別 、 期貨期權學院 、 期貨期權入門 、 期貨期權遠期 、 期貨與期權論文 、 商品期貨期權 、 豆粕期貨期權 、 期權對沖期貨 、 期權和期貨優劣 、 期貨期權交易 、 期貨期權實訓 、 期貨期權的比較 、 股指期貨期權 、 Input:Btime(0930),Etime(1445);
?
//?定義時間段。
var:Thigh(0),Tlow(0), mp(0),x(0),y(0),m(6),ma(0),flag1(0),flag2(0);
?
//?定義變量
if date<>date[1] then begin
? ? mp=0;
? ? x=0;
? ? y=0;
? ? Thigh=0;
? ? Tlow=0;
? ? flag1=0;
? ? flag2=0;
end;
?
//?來源:程序化99( www.tumamayizhan.com )每天給變量重新賦值。
if time=Btime then begin
? ?Thigh=highD(0);
? ?Tlow=lowD(0);
end;
?
//?給高點跟低點賦值,以開盤前6個bar的最高為高點,最低為低點。
value1=tl_new(date,900,thigh,date,1500,thigh);
value2=tl_new(date,900,tlow,date,1500,tlow);
?
//?繪圖上下軌。
ma=Average(close,m);
?
//?均線價格。修改m值即可調整用來過濾的均線。
mp=marketposition;
?
//?來源:程序化99( www.tumamayizhan.com )持倉多空定義。
if mp[1]<>1 and mp=1 then begin
? ?x=1;
end;
if mp[1]<>-1 and mp=-1 then begin
? ?y=1;
end;
?
//?用來控制每天多空的進場次數。
if time>Btime and time<Etime then begin
? ?if mp=0 and close crosses above thigh then begin
? ?? ?flag1=1;
? ?end;
?
//?來源:程序化99( www.tumamayizhan.com )當價格上穿上軌時給flag1賦值。
? ?? ?if flag1=1 and x<=1 and ma>=thigh then
? ?? ?? ?buy ("b1")next bar at Thigh+1 stop;
end;
?
//?來源:程序化99( www.tumamayizhan.com )當價格上穿后且均線也上穿上軌此時做多。
? ?? ?if mp<>-1 then sell("sp") next bar at tlow stop;
?
//?來源:程序化99( www.tumamayizhan.com )做多后以下軌的價格做出場點位。防止反向虧損。
if time>Btime and time<Etime then begin
? ?if mp=0 and close crosses below Tlow then begin
? ?? ?flag2=1;
? ?end;
?
//?來源:程序化99( www.tumamayizhan.com )當價格下穿下軌時給flag2賦值。
? ?? ?if flag2=1 and y<=1 and ma<=Tlow then
? ?? ?? ?sellshort("s1") next bar at tlow-1 stop;
end;
?
//?當價格下穿且均線下穿下軌此時做空。
? ?? ?if mp<>1 then buytocover("bp") next bar at thigh stop;
?
//?做空后以上軌的價格做出場點位,防止反向虧損。 本主題由 tcadmin 于 7?天前 移動
?
?
公式導入教程: 【通達信公式源碼導入方法教程】 【同花順公式源碼導入方法教程】 【大智慧新一代公式源碼導入方法教程】
?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容