請(qǐng)大神看一下為什么同一個(gè)k反復(fù)開平呢 [金字塔]
-
咨詢內(nèi)容:
多單在同一個(gè)k反復(fù)開平 請(qǐng)問怎么回事呢?INPUT:grid(50,1,11111,1);
variable:level=0;
n : =5;
dist:=barslast(holding=0 );??
oo:=ref(open,dist);
kaishi:=3000;
shang:=kaishi+n*grid*mindiff;
xia:=kaishi -n*grid*mindiff;
oo:=ref(open,dist);
kaishi:=3000;
shang:=kaishi+n*grid*mindiff;
xia:=kaishi -n*grid*mindiff;
?if l < xia or h >shang then begin????? if holding=0 then begin
??????????? dnprice:=oo-grid*mindiff;?????????? if low<=dnprice then begin
?????????????? buy(1,1,limitr,dnprice);
??????????????? level:=-1;
?????????? end
?????? end
?????? if holding=0 then begin
???????????? upprice:=oo+grid*mindiff;?????????? if high>=upprice then begin
??????????????? buyshort(1,1,limitr,upprice);
??????????????? level:=1;
??????????? end
??????? end
???? if holding>0? then begin
????????????? upprice:=oo+(level+1)*grid*mindiff;
??????????????? dnprice:=oo+(level-1)*grid*mindiff;?????????? if high>=upprice then begin
??????????????? sell(1,1,limitr,upprice);
??????????????? level:=level+1;
??????????? end?????????? if low<=dnprice then begin
??????????????? buy(1,1,limitr,dnprice);
?????????????? level:=level-1;
??????????? end
???? end
???????? if holding<0?? then begin
??????????????? upprice:=oo+(level+1)*grid*mindiff;
??????????????? dnprice:=oo+(level-1)*grid*mindiff;???????????? if low<=dnprice then begin
?????????????????? sellshort(1,1,limitr,dnprice);
??????????????????? level:=level-1;
???????????? end????????????? if high>=upprice then begin
???????????????????? buyshort(1,1,limitr,upprice);
????????????????????? level:=level+1;
????????????? end
??????? end
??????? if holding>0 then BEGIN
??????? if low < oo-n*grid*mindiff then begin
???????????? sell(1,holding,limitr,close);
???????????? end
???????????? end
??????? if? holding < 0 then begin
???????? if h > oo+n*grid*mindiff then begin
????????? sellshort(1,holding,limitr,close);
????????? end
????????? end
?????????
????????
end?
-
金字塔客服:
測(cè)試螺紋rb1710合約
?
?來源:程序化久久網(wǎng)( www.kzuj.com.cn )
- 用戶回復(fù): 你把你的公式加載道圖標(biāo)上輸出相關(guān)條件進(jìn)行分析
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容