 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
GLOBALVARIABLE:stt:=0,n:=0,初始资金:=tASSET;;
CYC:BARSLAST(MONTH>REF(MONTH,1) OR YEAR>REF(YEAR,1))+1;
今开:ref(OPEN,CYC-1);//CALLSTOCK(STKLABEL,VTOPEN,8,0);
上轨:今开*(1+GG);
下轨:今开*(1-GG);
ss:INTPART( max(1,INTPART(初始资金*0.10)/abs(close*MULTIPLIER*0.13)));
kd:=h>上轨 and c>上轨 and L>上轨 and ISUP;
kk:=L<下轨 and C<下轨 AND H<下轨 and ISDOWN;
//止盈
ZY:=h>上轨+((上轨-下轨)*g);
ZS:=L<下轨-((上轨-下轨)*g);
if stt<=1 and (zs or zy) then BEGIN //必须保证if这里条件满足时候下面2个平仓得有一个执行,否则在止盈不满足的情况下stt照样会被赋值成1.
tSELLSHORT(zs and tsellholding(1)>0,SS,mkt);
tSELL(zy and tbuyholding(1)>0,SS,mkt);
sTT:=1;
end
PK:h>上轨 and c>上轨 ;
if PK then
tSELLSHORT(tsellholding(1)>0,SS,mkt);
PD:L<下轨 and C<下轨 ;
if PD then
tSELL(tbuyholding(1)>0,SS,mkt);
if kd AND STT<1 and n<=5 and cyc>1 then BEGIN
if tBUY( tbuyholding(1)=0 ,SS,mkt) then
n:=n+1;
end
if kk AND STT<1 AND n<=5 and cyc>1 then BEGIN
IF tBUYSHORT(tsellholding(1)=0 ,SS,mkt) THEN
n:=n+1;
end
if MONTH<>ref(MONTH,1) then BEGIN
n:=0;
stt:=0;
end
IF ISMONTHEND=1 AND 1 THEN BEGIN
tSELLSHORT(tsellholding(1)>0,SS,mkt);
tSELL(tbuyholding(1)>0,SS,mkt);
n:=0;
stt:=0;
end |
|