日线空头排列,收盘价小于5均线,并且前10根K线其中有根收盘价大于5均线做一手空,亏损1%加仓一手(只加一次),亏损2%再加仓一手(只加一次),
最多加两次仓(总仓位小于等于3手)。总亏损5%全平,总盈利10%全平;(用于15分钟)
新建一个指标A,把非本周期的判断都放进去:
m1:=ma(c,30);
m2:=ma(c,60);
m3:=ma(c,120);
ktpl:m1<m2 and m2<m3;
当前指标下:
VARIABLE:ct:=0;
ktpl:"A.ktpl#DAY";
ma5:ma(c,5);
kc1:c<ma5 and ref(count(c>ma5,10),1)>=1;
pk1:=(AVGENTERPRICE-c)/AVGENTERPRICE>=0.1;//止盈平仓
pk2:=(c-AVGENTERPRICE)/AVGENTERPRICE>=0.05;//止损平仓
if pk1 and holding<0 then
begin
sellshort(holding<0,holding,market);
ct:=0;
end
if pk2 and holding<0 then
begin
sellshort(holding<0,holding,market);
ct:=0;
end
if kc1 and holding=0 then buyshort(1,1,market);
if holding<0 and ct=0 and (c-ENTERPRICE)/ENTERPRICE>=0.01 then //上次开仓之后 价格上涨1% 加仓
begin
加仓1:buyshort(1,1,market);
cT:=ct+1;
end
if holding<0 and ct=1 and (c-ENTERPRICE)/ENTERPRICE>=0.02 then //上次开仓之后 价格上涨2% 加仓
begin
加仓2:buyshort(1,1,market);
cT:=ct+1;
end
hd:holding;