DMA7:MA(C,7),SHIFT5,COLORGREEN,;
上面是一条均线。思路是跨周期的趋势操作,就是先观察大周期。在用小周期操作。
日线为例:当前日线股价大于均线时,只做多,30分均线股价上穿均线开多,下穿均线平仓。或因定金额3%止损止赢。
当前日线股价小于均线时,只做空,30分均线下穿均线开空,上穿均线平仓。或因定金额3%止损止赢。
同理看15分周期,操作用5分周期或3分周期。
搞了好久没搞成,请版主帮下忙。
input:保证金(0.20,0,10,0.01);
ma30:ma(c,30);
mak:"MA.MA3##day";
开场:round(enterprice*保证金*0.03),LINETHICK0;
ab:=IF(holding>0,HHV(HIGH,TYPEBAR(1,1))-开场,l-开场);
PARTLINE( holding>0, ab, colorrgb(255,0,0));
pd:=(holding>0 and ab>c);
ba:=IF(holding<0,LLV(LOW,TYPEBAR(1,3))+开场,h+开场);
PARTLINE(holding<0, ba, colorrgb(0,255,0));
pk:=(holding<0 and ba<c);
if pd then sell(1,holding,limitr,c);
if pk then sellshort(1,holding,limitr,c);
if cross(ma30,c) and holding>0 then sell(1,1,limitr,c);
if cross(c,ma30) and holding<0 then sellshort(1,1,limitr,c);
if cross(c,ma30) and c>mak and holding=0 then buy(1,1,limitr,c);
if cross(ma30,c) and c<mak and holding=0 then buyshort(1,1,limitr,c);
资产:round(ASSET),NOAXIS;
胜率:ROUNDS(100*PERCENTWIN,1),LINETHICK0;
不知道对不对。参数啥的自己换吧
非常感谢楼上的兄弟帮忙,不过好像不是我要的哦,要按我的那条指定均线来编写可以吗,那条均线是特殊的均线。
下面是我自己改的,不过通不过。
input:保证金(0.20,0,10,0.01);
DMA7:MA(C,7),SHIFT5;
mak:"MA.MA3##day";
开场:round(enterprice*保证金*0.03),LINETHICK0;
ab:=IF(holding>0,HHV(HIGH,TYPEBAR(1,1))-开场,l-开场);
PARTLINE( holding>0, ab, colorrgb(255,0,0));
pd:=(holding>0 and ab>c);
ba:=IF(holding<0,LLV(LOW,TYPEBAR(1,3))+开场,h+开场);
PARTLINE(holding<0, ba, colorrgb(0,255,0));
pk:=(holding<0 and ba<c);
if pd then sell(1,holding,limitr,c);
if pk then sellshort(1,holding,limitr,c);
if cross(dma7,c) and holding>0 then sell(1,1,limitr,c);
if cross(c,dma7) and holding<0 then sellshort(1,1,limitr,c);
if cross(c,dma7) and c>mak and holding=0 then buy(1,1,limitr,c);
if cross(dma7,c) and c<mak and holding=0 then buyshort(1,1,limitr,c);
资产:round(ASSET),NOAXIS;
胜率:ROUNDS(100*PERCENTWIN,1),LINETHICK0;
input:保证金(0.20,0,10,0.01);
DMA7:MA(C,7),SHIFT5;
mak:"MA.MA3##day";
开场:round(enterprice*保证金*0.03),LINETHICK0;
ab:=IF(holding>0,HHV(HIGH,TYPEBAR(1,1))-开场,l-开场);
PARTLINE( holding>0, ab, colorrgb(255,0,0));
pd:=(holding>0 and ab>c);
ba:=IF(holding<0,LLV(LOW,TYPEBAR(1,3))+开场,h+开场);
PARTLINE(holding<0, ba, colorrgb(0,255,0));
pk:=(holding<0 and ba<c);
if pd then sell(1,holding,limitr,c);
if pk then sellshort(1,holding,limitr,c);
if cross(dma7,c) and holding>0 then sell(1,1,limitr,c);
if cross(c,dma7) and holding<0 then sellshort(1,1,limitr,c);
if cross(c,dma7) and c>mak and holding=0 then buy(1,1,limitr,c);
if cross(dma7,c) and c<mak and holding=0 then buyshort(1,1,limitr,c);
资产:round(ASSET),NOAXIS;
胜率:ROUNDS(100*PERCENTWIN,1),LINETHICK0;
你写的我用了啊。好使啊。没问题啊。DMA7:MA(C,7),SHIFT5;你这个是什么均线啊。好神奇啊。
嗯。我知道会出现什么问题。
input:保证金(0.20,0,10,0.01);
DMA7:MA(C,7),SHIFT5;
mak:"MA.MA3##day";
开场:round(enterprice*保证金*0.03),LINETHICK0;
ab:=IF(holding>0,HHV(HIGH,TYPEBAR(1,1))-开场,l-开场);
PARTLINE( holding>0, ab, colorrgb(255,0,0));
pd:=(holding>0 and ab>c);
ba:=IF(holding<0,LLV(LOW,TYPEBAR(1,3))+开场,h+开场);
PARTLINE(holding<0, ba, colorrgb(0,255,0));
pk:=(holding<0 and ba<c);
if pd then sell(1,holding,limitr,c);
if pk then sellshort(1,holding,limitr,c);
if cross(dma7,c) and holding>0 then sell(1,1,limitr,c);
if cross(c,dma7) and holding<0 then sellshort(1,1,limitr,c);
if cross(c,dma7) and c>mak and holding=0 then buy(1,1,limitr,c);
if cross(dma7,c) and c<mak and holding=0 then buyshort(1,1,limitr,c);
资产:round(ASSET),NOAXIS;
胜率:ROUNDS(100*PERCENTWIN,1),LINETHICK0;
你写的我用了啊。好使啊。没问题啊。DMA7:MA(C,7),SHIFT5;你这个是什么均线啊。好神奇啊。
嗯。我知道会出现什么问题。
我一用就卡死,软件卡死用不了就像死机一样
没问题啊。我这用好使不知道你咋弄的