以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  为什么开仓信号是两个?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=79566)

--  作者:uime
--  发布时间:2015/6/9 18:15:04
--  为什么开仓信号是两个?
variable:yuanshi=asset;//初始化原始资金;
TR1 := MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR : =MA(TR1,20);//用atr来设置每次试错的最大成本
up:ref(hhv(h,20),1);//设置20日高点为上轨
down:ref(llv(l,20),1);//设置20日低点为下轨
kd:=cross(close,up);//新开多仓条件
kk:=cross(down,close);//新开空仓条件

duojia:=close>(enterprice+3*atr) and asset>yuanshi;//如果帐面盈利,每间隔3个atr加一次多仓;
kongjia:=close<(enterprice-3*atr) and asset>yuanshi;//如果帐面盈利,每间隔3个atr加一次空仓;

duozhisunprice:=cross(enterprice-atr*1.1,close);//多仓止损条件:反向波动1.1个atr;
kongzhisunprice:=cross(close,enterprice+atr*1.1);//空仓止损条件:反向波动1.1个atr;

duozhisuntime:=(enterbars>=10 and close<enterprice+3*atr);//多仓时间止损:持仓10天未达到3个atr盈利,退出;
kongzhisuntime:=(enterbars>=10 and close>enterprice-3*atr);//空仓时间止损:持仓10天未到3个atr盈利,退出

//duoyingliprice:=cross(close,enterprice+3*atr);
//kongyingliprice:=cross(enterprice-3*atr,close);

buy(kd and holding=0,asset*0.02/(atr*1.1)/multiplier,thisclose);
buy(duojia and holding>0,asset*0.02/(atr*1.1)/multiplier,thisclose);
//sell(duozhisunprice and holding>0,100%,limitr,enterprice-atr*1.1);
sell(duozhisuntime and holding>0,100%,thisclose);

buyshort(kk and holding=0,asset*0.02/(atr*1.1)/multiplier,thisclose);
buyshort(kongjia and holding<0,asset*0.02/(atr*1.1)/multiplier,thisclose);
//sellshort(KONGZHISUNPRICE and holding<0,100%,limitr,enterprice+atr*1.1);
sellshort(kongzhisuntime and holding<0,100%,thisclose);

每次开仓时都开两个,请版主帮忙找找原因,谢谢

--  作者:jinzhe
--  发布时间:2015/6/10 8:48:35
--  

是k线图上一根k线里面出了两个信号?

还是一个信号下了两次单?


--  作者:uime
--  发布时间:2015/6/10 17:38:08
--  
是开仓信号下了两次单
--  作者:jinzhe
--  发布时间:2015/6/11 8:48:35
--  

一个信号两个单?

发下单日志


--  作者:uime
--  发布时间:2015/6/12 8:27:34
--  
怎么看下单日志?
--  作者:jinzhe
--  发布时间:2015/6/12 8:50:26
--  

把这个勾了

勾好后看系统的提示,会提示下单日志保存在哪里


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看