从0.7.7升级了Quantstrat 0.7.8,然后旧代码不起作用 [英] Upgraded quantstrat 0.7.8 from 0.7.7 then old code does not work

查看:62
本文介绍了从0.7.7升级了Quantstrat 0.7.8,然后旧代码不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Quantstrat软件包从0.7.7(2013年1月7日安装)升级到0.7.8,但是旧代码无法正常工作.看来我们不能放任何买入或卖出的挂单,仅执行挂单.这是细节.有人知道在add.rule或applyStrategy函数中有重大更改或已报告相同问题吗?

I have upgraded quantstrat package from 0.7.7(installed on Jan 7th 2013) to 0.7.8, however old code does not work properly. looks like we can not put any entry orders niether buy or sell, and only exit orders are executed. Here is the detail. Someone knows major changes in add.rule or applyStrategy function or same issue has been reported?

我们通过add.rule()设置交易规则

We set up trading rule by add.rule()

    add.rule(f,'ruleSignal',arguments=list(sigcol="DoSell",sigval=TRUE,orderqty=(-1*tradeSize),osFUN='osSUS',ordertype='market',TxnFees="calcTxnFee",prefer='Open'),type='enter',label=gExitLabel)
    add.rule(f,'ruleSignal',arguments=list(sigcol="DoBuy", sigval=TRUE,orderqty=tradeSize,osFUN='osBuy',ordertype='market',TxnFees="calcTxnFee",prefer='Price'),type='enter',label=gEnterLabel)
    add.rule(f,'ruleSignal',arguments=list(sigcol="DoStop", sigval=TRUE,orderqty=-1*tradeSize,osFUN='osStop',ordertype='stoplimit',threshold='StopLevel',TxnFees="calcTxnFee"),type='risk',label='Stop')

我们遇到的问题是,当我们运行applyStrategy时,我们没有收到进入信号…………看来getOrderbook具有购买"和出售"……..

The problem we had is we don't get entry signal when we run applyStrategy ...... It seems that getOrderbook has "Buy" and "Sell" .....

 applyStrategy(rs, rs)  only applied sell signal ........(not buy)

[1] "2010-11-18 09:00:00 ABC -65660 @ 4.6"
[1] "2010-12-07 09:00:00 ABC -37509 @ 5.17"

但是getOrderBook()记录了购买"和出售"的顺序... 同时,系统将order.price设置为"0",将order.status设置为已替换",并设置为价格"

However getOrderBook() recorded "Buy", and "Sell" in order ..... at the same time order.prices were set "0", order.status "replaced" and Prefer "Price" by the system

推荐答案

很难确切地理解您的问题是:没有输入信号",订单有买卖"(无论如何),订单".价格设置为0"...

It is hard to understand what is your problem exactly: "no entry signal", "orderbook has Buy and Sell" (whatever that means), "order.prices were set to 0" ...

我看到您正在使用自己的订单大小调整功能,这可能与此有关吗?您可以尝试放弃订单大小测试功能,只是为了检查您的挂单是否正在执行.

I see that you are using your own order sizing functions, could it have something to do with that? You may try dropping your order sizing functions for a test, just to check if your entry orders are being executed.

否则,我建议您提供一个完整的示例,以便我可以运行它并进行检查.

Otherwise I suggest that you provide a complete example so I can run it and check.

请注意,quantstrat的开发工作非常繁重,并且几乎每天都会对代码进行修补,尽管版本号可能不会总是增加.因此,请确保您始终下载最新的代码.

Please be aware that quantstrat is under heavy development and that the code is patched almost on a daily basis, although the version number may not always be bumped up. So make sure that you always download the latest code.

HTH,

Jan Humme.

Jan Humme.

这篇关于从0.7.7升级了Quantstrat 0.7.8,然后旧代码不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆