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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [原创]平仓明细输出到csv的模板

   

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


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

主题:[原创]平仓明细输出到csv的模板

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[原创]平仓明细输出到csv的模板  发帖心情 Post By:2011/1/9 18:00:09    Post IP:114.243.135.204[只看该作者]

以下内容为程序代码:

1 runmode:0;
2
3 input:debug(1,0,1,1);
4
5 pathfile:='c:\tradelog.csv';
6
7 enterhour:=ref(hour,enterbars);
8 enterminute:=ref(minute,enterbars);
9
10 commission:=selfdata('commission');
11
12 if holding>0 then begin
13     lots:=holding;
14     
15     if debug=1 then begin
16         debugcontent:=numtostr(year,0)+'-'+numtostr(month,0)+'-'+numtostr(day,0)+','+stkname+','+
17                     numtostr(enterhour,0)+':'+numtostr(enterminute,0)+','+numtostr(enterprice,0)+',Buy,'+
18                     numtostr(hour,0)+':'+numtostr(minute,0)+','+numtostr(exitprice,0)+','+
19                     numtostr(exitprice-enterprice,0)+','+numtostr(2*commission,0)+','+numtostr(lots,0)+','+
20                     numtostr(numprofit(1),0)+','+numtostr(asset,2);    
21         debugfile2(pathfile,debugcontent,0,0);                
22     end
23 end
24
25 if holding<0 then begin
26     lots:=holding;
27     if debug=1 then begin
28         debugstring:=numtostr(year,0)+'-'+numtostr(month,0)+'-'+numtostr(day,0)+','+stkname+','+
29                     numtostr(enterhour,0)+':'+numtostr(enterminute,0)+','+numtostr(enterprice,0)+',Sell,'+
30                     numtostr(hour,0)+':'+numtostr(minute,0)+','+numtostr(exitprice,0)+','+
31                     numtostr(enterprice-exitprice,0)+','+numtostr(2*commission,0)+','+numtostr(lots,0)+','+
32                     numtostr(numprofit(1),0)+','+numtostr(asset,2);    
33         debugfile2(pathfile,debugcontent,0,0);                
34     end
35 end

 

 

图片点击可在新窗口打开查看

[此贴子已经被作者于2011-1-9 18:02:03编辑过]

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


加好友 发短信
等级:蜘蛛侠 帖子:1366 积分:5210 威望:0 精华:7 注册:2010/12/11 18:00:33
  发帖心情 Post By:2011/1/9 18:30:49    Post IP:183.39.138.188[只看该作者]

不错的东西,可是我放到我的交易系统中,输出的数据重复3遍,而且只有BUY没有Sell

 


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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
  发帖心情 Post By:2011/1/11 10:12:09    Post IP:114.241.173.115[只看该作者]

图片点击可在新窗口打开查看

 回到顶部