咨詢內(nèi)容:
多單在同一個k反復(fù)開平 請問怎么回事呢?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