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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 请高手帮忙看看问题出在哪里

   

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


  共有5745人关注过本帖平板打印复制链接

主题:请高手帮忙看看问题出在哪里

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


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2012/2/22 23:41:14 [只看该作者]

2个错误比较明显:

1,平仓时,要全部平仓的吧 ,不能填,填0,这样写sell(1,0,thisclose);   sellshort(1,0,thisclose)

 

2

//出现浮动亏损比如2%平仓

if holding>0  then begin
if win<-2 and numprofit(1)<0 then begin
  多止损: sell(1,holding,thisclose);
   buynum:=1;      //止损后是要加仓的,怎么会重置为1呢?
   sellnum:=1;

   end
end

 

if holding<0 then begin

if win<-2  and numprofit(1)<0 then
   空止损: sellshort(1,holding,thisclose);
   buynum:=1;
   sellnum:=1;

   end

 

改为

//出现浮动亏损比如2%平仓

if holding>0  then begin
if win<-2 then begin
  多止损: sell(1,holding,thisclose); 
   end
end

 

if holding<0 then begin

if win<-2 then
   空止损: sellshort(1,holding,thisclose);
   end

 

 

 

另外,平仓最好放开仓前面。

[此贴子已经被作者于2012-2-22 23:51:49编辑过]

 回到顶部
总数 14 1 2 下一页