以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  策略编写求助区  (http://weistock.com/bbs/list.asp?boardid=11)
----  日内交易策略思路编写求助  (http://weistock.com/bbs/dispbbs.asp?boardid=11&id=7634)

--  作者:jieni
--  发布时间:2011/8/21 19:56:59
--  日内交易策略思路编写求助

DMA7:MA(C,7),SHIFT5,COLORGREEN,;

上面是一条均线。思路是跨周期的趋势操作,就是先观察大周期。在用小周期操作。

日线为例:当前日线股价大于均线时,只做多,30分均线股价上穿均线开多,下穿均线平仓。或因定金额3%止损止赢。

当前日线股价小于均线时,只做空,30分均线下穿均线开空,上穿均线平仓。或因定金额3%止损止赢。

同理看15分周期,操作用5分周期或3分周期。

 

 

搞了好久没搞成,请版主帮下忙。

                     


--  作者:jieni
--  发布时间:2011/8/21 19:58:04
--  
编写成交易策略,想测试下效果。
--  作者:xian_0_9
--  发布时间:2011/8/22 10:33:45
--  

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;

 

不知道对不对。参数啥的自己换吧

 

[此贴子已经被作者于2011-8-22 10:35:05编辑过]

--  作者:jieni
--  发布时间:2011/8/22 13:15:32
--  

非常感谢楼上的兄弟帮忙,不过好像不是我要的哦,要按我的那条指定均线来编写可以吗,那条均线是特殊的均线。

下面是我自己改的,不过通不过。

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;

[此贴子已经被作者于2011-8-22 13:43:10编辑过]

--  作者:fly
--  发布时间:2011/8/22 13:45:42
--  
不建议使用大周期上的最新价做为开仓条件,因为最新价是在不断变化的,这样会造成交易信号的不稳定
--  作者:xian_0_9
--  发布时间:2011/8/22 14:03:45
--  

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;你这个是什么均线啊。好神奇啊。

嗯。我知道会出现什么问题。


--  作者:jieni
--  发布时间:2011/8/22 17:15:03
--  
是的,大周期上的要采用收盘价来确定的。小周期也是收盘价。
--  作者:jieni
--  发布时间:2011/8/22 17:15:49
--  
以下是引用xian_0_9在2011-8-22 14:03:45的发言:

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;你这个是什么均线啊。好神奇啊。

嗯。我知道会出现什么问题。

 我一用就卡死,软件卡死用不了就像死机一样


--  作者:jieni
--  发布时间:2011/8/22 17:18:54
--  
这个肯定哪里有问题,我一运行上面公式就卡死,请出手相助。
--  作者:xian_0_9
--  发布时间:2011/8/22 20:01:27
--  

没问题啊。我这用好使不知道你咋弄的