Rss & SiteMap

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

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

标题:老师帮检查一下、

1楼
苦麻菜真好吃 发表于:2016/7/11 22:13:43
这样写应该没问题吧、为什么这当条件K1不满足的时候也会开多?设置的周期、都对了

这MACD 的调用写法应该没错吧、?



ZH:='';
PZ1:='RM09';

INPUT:P(26,20,100,8),S(12,5,40,4),M(9,2,60,6);

DIFF : EMA(CLOSE,S) - EMA(CLOSE,P);
DEA  : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;

K1:DIFF<0 AND DEA<0 AND DIFF>DEA;//多
k2:DIFF>0 AND DEA>0 AND DIFF<DEA;//空

KD:DYNAINFO2(7, PZ1)>ref(hhv(h,5),1);//开多
KK:DYNAINFO2(7, PZ1)<ref(llv(l,5),1);//开空




PD:DYNAINFO2(7, PZ1)<ref(llv(l,3),1);//平多
PK:DYNAINFO2(7, PZ1)>ref(hhv(h,3),1);//平空

K3:DIFF>0 AND DEA>0 AND CROSS(DEA,DIFF);//平多
K4:DIFF<0 AND DEA<0 AND CROSS(DIFF,DEA);//平空


if PD OR K2 then begin//多
tsell(1,1,mkt);
end

if PK OR K1 then begin//空
tsellshort(1,1,mkt);
end

if KK and K2 and tbuyholdingex('',pz1,0)=0 and tsellholdingex('',pz1,0)=0 then begin//开空
tbuyshort(1,1,mkt);
end

if KD AND K1 AND tbuyholdingex('',pz1,0)=0 and tsellholdingex('',pz1,0)=0 then begin //开多
tbuy(1,1,mkt);
end
2楼
jinzhe 发表于:2016/7/12 9:07:13

需要调试,不调试就不知道为什么会发生用户讲的问题,用debugfile等函数调试出对应的开仓条件以及开仓条件所用的数据,再回头去验证实际的情况和用户想的是否一样

3楼
苦麻菜真好吃 发表于:2016/7/12 9:43:14
debugfile('D:\P.txt','K1',DIFF<0);

是这样写吗?
4楼
jinzhe 发表于:2016/7/12 9:46:21
debugfile('d:\test.txt','k1= %.0f',k1);
debugfile('d:\test.txt','diff= %.1f',diff);
debugfile('d:\test.txt','dea= %.1f',dea);
共4 条记录, 每页显示 10 条, 页签: [1]


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