 
等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
ma10:ma(c,10);
ma20:ma(c,20);
买入突破线:valuewhen(cross(ma10,ma20),hhv(high,12)+3*mindiff);
卖出突破线:valuewhen(cross(ma20,ma10),llv(high,12)-3*mindiff);
if close>买入突破线 and holding<=0 then
BEGIN
sellshort(1,holding,marketr);
buy(1,1,marketr);
END
if close<卖出突破线 and holding>=0 then
BEGIN
sell(1,holding,marketr);
buyshort(1,1,marketr);
END
//周期出场
if low=llv(low,8) then sell(1,holding,marketr);
if high=hhv(high,8) then sellshort(1,holding,marketr);
//重新进场
if TYPEBAR(1,2)<=15 and close>ref(hhv(high,10),TYPEBAR(1,2)) then buy(holding=0,1,marketr);
if TYPEBAR(1,4)<=15 and close<ref(llv(low,10),TYPEBAR(1,4)) then buyshort(holding=0,1,marketr); |
|