欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 为什么开仓信号是两个?

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有2225人关注过本帖树形打印复制链接

主题:为什么开仓信号是两个?

帅哥哟,离线,有人找我吗?
uime
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:114 积分:27 威望:0 精华:0 注册:2013/5/9 7:26:16
为什么开仓信号是两个?  发帖心情 Post By:2015/6/9 18:15:04    Post IP:218.28.92.185[显示全部帖子]

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);

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

 回到顶部
帅哥哟,离线,有人找我吗?
uime
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:114 积分:27 威望:0 精华:0 注册:2013/5/9 7:26:16
  发帖心情 Post By:2015/6/10 17:38:08    Post IP:218.28.92.185[显示全部帖子]

是开仓信号下了两次单

 回到顶部
帅哥哟,离线,有人找我吗?
uime
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:114 积分:27 威望:0 精华:0 注册:2013/5/9 7:26:16
  发帖心情 Post By:2015/6/12 8:27:34    Post IP:218.28.92.185[显示全部帖子]

怎么看下单日志?

 回到顶部