等级: 新手上路
- 注册:
- 2021-6-24
- 曾用名:
|
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
BPK:=CROSS(MA5,MA10);
SPK:=CROSS(MA10,MA5);
IF holding<=0 and BPK THEN
BEGIN
sellshort(holding<0,0,market); //卖平空单
Buy(holding=0,1,market); //买开多单
END
IF holding>=0 and SPK THEN
BEGIN
sell(holding>0,holding,market); //买平多单
buyShort(holding=0,1,MARKET);//卖开空单
END
HH:=HHV(H,ENTERBARS);
LL:=LLV(L,ENTERBARS);
A1:=ENTERPRICE*1.02;
A2:=ENTERPRICE*1.04;
A3:=ENTERPRICE*1.009;
A4:=HH*0.979;
A5:=ENTERPRICE*1.05;
B1:=ENTERPRICE*0.98;
B2:=ENTERPRICE*0.96;
B3:=ENTERPRICE*0.991;
B5:=ENTERPRICE*0.95;
B4:=LL*1.021;
SP:=((C<=ENTERPRICE*0.981)||(HH>=A1&&HH<=A2&&C<=A3)||(HH>A2&&C<=A4))&&ENTERBARS>1;
BP:=((C>=ENTERPRICE*1.019)||(LL<=B1&&LL>=B2&&C>=B3)||(LL<B2&&C>=B4))&&enterbars>1;
多盈:SELL(SP,1,market);
空盈:SELLSHORT(BP,1,market);
|
|