Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:盈亏比例

1楼
guohg129 发表于:2016/9/6 10:14:01

有哪个函数可以取买入的品种的盈亏比例?

2楼
jinzhe 发表于:2016/9/6 10:15:57
函数PAYOFFRATE
3楼
guohg129 发表于:2016/9/6 10:26:48

如果我的是某一特定品种的盈亏比呢,而且我是准备些在后台交易系统里,怎么写呢?

 

谢谢

4楼
jinzhe 发表于:2016/9/6 10:37:32
这个需要计算得出了,还有这个品种盈亏比是只计算当天交易的吗?
5楼
guohg129 发表于:2016/9/6 10:49:18

因为我的是日内交易策略,所以是计算当前的盈亏比,为了止损用

6楼
jinzhe 发表于:2016/9/6 11:05:30

在用户的策略最后加上:

 

if tenterbars=1 and time<>extgbdata(stklabel+'tt') then begin

    if tnumprofit(1)>0 then extgbdataset(stklabel+'ying',extgbdata(stklabel+'ying')+tnumprofit(1));

    if tnumprofit(1)<0 then extgbdataset(stklabel+'kui',extgbdata(stklabel+'kui')+tnumprofit(1));

    extgbdataset(stklabel+'tt',time);

end

盈亏比:extgbdata(stklabel+'ying')/extgbdata('stklabel'+kui);

 

 

if time=closetime(0) then begin

    extgbdataset(stklabel+'ying',0);

    extgbdataset(stklabel+'kui',0);

end

 

 

共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03906 s, 3 queries.