小弟目前在用R做交易策略,以及回测。 请问这里有用R的前辈么?希望和你们交流。 目前交易系统模型大概如下: 1.Quantmod:绘图 2.TTR:技术指标计算 3.mFilter:做信号过滤 4.candlesticks:烛形识别 希望有用R做相关数据分析的前辈们留个脚印,大家可以相互交流
我目前在python环境下调用R做运算,然后在python初步实现了自动交易系统。目前还在完善。 我没有用过游程检测,我主要用R的quantstrat做回测,利用R写一些时间逻辑类的指标,还有就是曲线拟合了。你是用c++开发交易交易系统,调用R做策略运算么? R下面有没有做过 图形模式识别?
我也在 Python 环境内嵌 R 跑 Quantstrat 回测,用 Python 包装了 Quantstrat API,方便动态组合各种系统。我对Python还算熟悉,对R和系统则只有粗浅的了解了。
quantstrat你用下来效果怎么样? 我回测的时候发现limit order是有问题的,价格没有更新成限价,而是仍然用的market close或者prefer. 我的email. upnm@yahoo.cn 楼上有机会多交流
addOrder函数里面 if(!is.null(threshold) & length(price)>=1 ) { if(length(grep(ordertype,c("stoplimit","stoptrailing","iceberg")))==1) { #we have a threshold set on a stop* order, process it #print(paste("adding order:",ordertype)) switch(ordertype, limit=, stoplimit =, iceberg =, stoptrailing = { #print("caculationg") if(isTRUE(tmult)){ #set the numeric theshold as threshold*price if(threshold<1) threshold = price*threshold else{ #get the difference between the threshold*price and the price threshold = price-(price*threshold) #positive threshold } tmult=FALSE #this sets the threshold as a fixed number for later trailing orders } price = price+threshold } ) #end type switch #print(paste("adding order:",ordertype,price,threshold)) } 原来switch里面没有limit选项,会造成limit order的 threshold,计算无法正常进行。已发送邮件给他们了。可能我们用的版本号不一样吧。