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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 测评有结果但是k线图上没信号

   

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


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

主题:测评有结果但是k线图上没信号

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


加好友 发短信
等级:论坛游民 帖子:169 积分:0 威望:0 精华:0 注册:2016/8/28 16:11:16
测评有结果但是k线图上没信号  发帖心情 Post By:2016/11/14 15:43:25    Post IP:180.169.30.6[只看该作者]

如下开平仓指令,模拟交易时开仓没问题,平仓有问题,是那里写错?

//建立多头的进场条件
long:=h>a and ref(c,1)>line ;
if long then
begin
//tsellshort(holding<0,0,mkt);
sellshort(holding<0,0,marketr);
//tbuy(holding=0,p,mkt)
buy(holding=0,p, limitr ,a);
end
//建立空头的进场条件
short:=l<b and ref(c,1)<line ;
if short then
begin
//tsell(holding>0,0,mkt);
sell(holding>0,0,marketr);
//tbuyshort(holding=0,p,mkt);
buyshort(holding=0,p,limitr,b);
end
//盈亏计算 
     if enterbars>0 then begin 
         win1:=(c-enterprice)/enterprice*10000; 
         if win1>maxprofit then 
             maxprofit:=win1; 
         win2:=(maxprofit-win1)/maxprofit*10000; 
     end 
 
     //多头初始浮亏 p1% 止损 
     if win1<-p1 then 
     begin
          //tsell(1,holding,mkt); 
         sell(1,holding,marketr); 
      end
 
     //多头利润大于 p2% 止盈 
     if win1>p2 then 
     begin
         //tsell(1,holding,mkt); 
         sell(1,holding,marketr); 
     end

     //多头获利后回撤 p3%止盈 
     if win2>p3 and openprofit>0 then 
    begin
         //tsell(1,holding,mkt); 
         sell(1,holding,marketr); 
    end

     
     //盈亏计算 
     if enterbars>0 then begin 
         win1:=(enterprice-c)/enterprice*100; 
         if win1>maxprofit then 
             maxprofit:=win1; 
         win2:=(maxprofit-win1)/maxprofit*10000; 
     end 
 
     //空头初始浮亏超过 p1% 止损 
     if win1<-p1 then 
     begin
         //tsellshort(1,holding,mkt); 
         sellshort(1,holding,marketr); 
     end
 
     //空头利润大于 p2%止盈 
     if win1>p2 then 
     begin
         //tsellshort(1,holding,mkt); 
         sellshort(1,holding,marketr); 
     end
      
     //空头回撤 p3% 止盈 
     if win2>p3 and openprofit>0 then 
     begin
         //tsellshort(1,holding,mkt); 
         sellshort(1,holding,marketr);
     end

持仓:holding,linethick0;
资产:asset,noaxis;
可用现金:cash(0),linethick0;

      

 回到顶部