Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共10 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:再请老师帮我修改一下

1楼
abc 发表于:2013/2/18 17:13:31

原有模型平仓止损后常出现错误空仓而错过趋势行情,(以下,不设置平仓止损条件,即用反手指令)

修改思路如下:

3分钟,5分钟,10分钟3个周期的4均线上穿9均线时开多单(可以在不同时间的K线上陆续上穿或陆续下穿)。3分钟,5分钟,10分钟3周期的4均线下穿9均线时开空单以此循环。

  

//公式2(公式2为主体公式):

sh3:=stkindi('','公式1.sh',0,17);
sh5:=stkindi('','公式1.sh',0,2);
sh10:=stkindi('','公式1.sh',0,18);

xc3:=stkindi('','公式1.xc',0,17);
xc5:=stkindi('','公式1.xc',0,2);
xc10:=stkindi('','公式1.xc',0,18);
if sh3 and sh5 and sh10 then buy(holding=0,1,market);
if xc3 or xc5 or xc10 then sell(holding>0,0,market);


sh3_2:=stkindi('','公式1.sh2',0,17);
sh5_2:=stkindi('','公式1.sh2',0,2);
sh10_2:=stkindi('','公式1.sh2',0,18);

xc3_2:=stkindi('','公式1.xc2',0,17);
xc5_2:=stkindi('','公式1.xc2',0,2);
xc10_2:=stkindi('','公式1.xc2',0,18);
if xc3_2 and xc5_2 and xc10_2 then buyshort(holding=0,1,market);
if sh3_2 or sh5_2 or sh10_2 then sellshort(holding<0,0,market);
2楼
jinzhe 发表于:2013/2/18 17:18:32
公式1的内容发出来
3楼
abc 发表于:2013/2/18 19:03:46
//公式1:
sh:ma(c,4)>ma(c,9);         
xc:cross(ma(c,9),ma(c,4)); 

//以下为开空平空止损
sh2:cross(ma(c,4),ma(c,9)); 
xc2:ma(c,4)<ma(c,9);



请老 师麻烦帮我把周期设置为可调数。谢谢老师      

4楼
jinzhe 发表于:2013/2/19 9:02:01

周期在stkindi函数里面设置,对函数最后一个参数进行修改。如果你不会,也不想学着改,那么我再怎么改写,都不行

 

其他条件不变,开平仓语句修改一下
if sh3 and sh5 and sh10 then begin
sell(holding>0,0,market);
 buyshort(holding=0,1,market);
end
 
if sh3_2 or sh5_2 or sh10_2 then begin
sellshort(holding>0,0,market);
buy(holding=0,1,market);
end
5楼
abc 发表于:2013/2/19 13:25:28
//公式1:
sh:ma(c,4)>ma(c,9);         
xc:cross(ma(c,9),ma(c,4)); 

sh2:cross(ma(c,4),ma(c,9)); 
xc2:ma(c,4)<ma(c,9);
另请老师麻烦帮我把周期设置为可调参数。谢谢老师!      

6楼
abc 发表于:2013/2/20 17:58:05
老师好!
是下面这样的吗?但出的,不知是什么原因?请老师帮我后并测试校对。谢谢!

/公式2: 公式2是主体公式

sh3:=stkindi('','公式1.sh',0,17);
sh5:=stkindi('','公式1.sh',0,2);
sh10:=stkindi('','公式1.sh',0,18);
xc3:=stkindi('','公式1.xc',0,17);
xc5:=stkindi('','公式1.xc',0,2);
xc10:=stkindi('','公式1.xc',0,18);

if sh3 and sh5 and sh10 then begin sell(holding>0,0,market);
 buyshort(holding=0,1,market);
 end



sh3_2:=stkindi('','公式1.sh2',0,17);
sh5_2:=stkindi('','公式1.sh2',0,2);
sh10_2:=stkindi('','公式1.sh2',0,18);
xc3_2:=stkindi('','公式1.xc2',0,17);
xc5_2:=stkindi('','公式1.xc2',0,2);
xc10_2:=stkindi('','公式1.xc2',0,18);

if sh3_2 or sh5_2 or sh10_2 then begin sellshort(holding>0,0,market);
buy(holding=0,1,market);
end
7楼
abc 发表于:2013/2/21 16:41:40
老师好!
是下面这样的吗?但出的,不知是什么原因?请老师帮我后并测试校对。谢谢!
另外,交易指令是用的收盘价吗?请帮我改为

//公式1:
sh:ma(c,4)>ma(c,9);         
xc:cross(ma(c,9),ma(c,4)); 
sh2:cross(ma(c,4),ma(c,9)); 
xc2:ma(c,4)<ma(c,9);

//公式2: 公式2是主体公式
sh3:=stkindi('','公式1.sh',0,17);
sh5:=stkindi('','公式1.sh',0,2);
sh10:=stkindi('','公式1.sh',0,18);
xc3:=stkindi('','公式1.xc',0,17);
xc5:=stkindi('','公式1.xc',0,2);
xc10:=stkindi('','公式1.xc',0,18);

if sh3 and sh5 and sh10 then begin sell(holding>0,0,market);
 buyshort(holding=0,1,market);
 end
8楼
jinzhe 发表于:2013/2/21 16:53:01
if sh3 and sh5 and sh10 then begin
sell(holding>0,0,limitr,c);
 buyshort(holding=0,1,limitr,c);
end
 
if sh3_2 or sh5_2 or sh10_2 then begin
sellshort(holding>0,0,limitr,c);
buy(holding=0,1,limitr,c);
end
9楼
abc 发表于:2013/2/22 16:01:30
信号不正常(测试行情 只有极少信号,而模型上一个交易信号没有), 是什请老师帮我检测一下。谢谢!
10楼
abc 发表于:2013/2/22 17:08:02
所有周期信号均不正常
共10 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.17969 s, 3 queries.