 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
新建一个公式A
a:ma(c,20)>ma(c,60);
然后当前策略用stkindi去引用
cond:stkindi('','A.a',0,6,0);
cond2:callstock('',vtclose,6,-1)>callstock('',vtopen,6,-1);
基准价:if(cond2,callstock('',vtclose,6,-1),callstock('',vtopen,6,-1));
if cross(close,基准价) then buy(1,1,marketr);
if openprofit<(-6*mindiff*holding) then sell(1,holding,marketr);
if openprofit>(-6*mindiff*holding) then sell(1,holding,marketr);
if time=closetime(0) then sell(1,holding,marketr);
|
|