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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 后台交易手数设置问题

   

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


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

主题:后台交易手数设置问题

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


加好友 发短信
等级:论坛游民 帖子:108 积分:0 威望:0 精华:0 注册:2014/5/9 10:13:40
后台交易手数设置问题  发帖心情 Post By:2014/6/30 16:37:26 [只看该作者]

我用阿火的模版做了个后台模型。
应用在橡胶连续 图表上面显示的虚拟持仓是192手, 而根据图表历史数据测试下来目前的持仓应该是1300手, 该模型采用1000万起始资金, 6%资金开仓, 橡胶价格为15000左右, 计算所得结果应该是40手。 
我不是很明白这个192手是怎么计算出来的。 我就想要当前这个时间点1000万起始资金, 6%开仓,能开橡胶多少收, 我该怎么做呢??

代码部分如下: 
runmode:0;
Globalvariable:hold=drawnull;
cc800988:=holding;

------
------
开空:BUYSHORT(SELLCOND AND HOLDING>=0,6%,LIMITR,C);
开多:BUY(BUYCOND AND HOLDING<=0,6%,LIMITR,C);



drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;

MyCount:='11111111';
xiadan800988:=cc800988-hold;
if xiadan800988>0.5 then begin
 cang:=min(xiadan800988,abs(hold));
 if hold<0 then begin
  tsellshort(1,cang,mkt,0,0,MyCount),allowrepeat;
  debugfile('D:\jyjl.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平空 %.0f',cang);
 end
 cang:=xiadan800988+min(hold,0);
 if cang>0 then begin
  tbuy(1,cang,mkt,0,0,MyCount),allowrepeat;
  debugfile('D:\jyjl.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开多 %.0f',cang);
 end
end
if xiadan800988<-0.5 then begin
 cang:=min(abs(xiadan800988),abs(hold));
 if hold>0 then begin
  tsell(1,cang,mkt,0,0,MyCount),allowrepeat;
  debugfile('D:jyjl.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平多 %.0f',cang);
 end
 cang:=abs(xiadan800988)-max(hold,0);
 if cang>0 then begin
  tbuyshort(1,cang,mkt,0,0,MyCount),allowrepeat;
  debugfile('D:\jyjl.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开空 %.0f',cang);
 end
end
hold:=cc800988;




 回到顶部