[英]add custom TA to chart.Posn()
I have the same problem as: Add Technical Indicator to chart.Posn我有同样的问题: 将技术指标添加到 chart.Posn
However, I am working with a custom indicator and it is plotting on top of the positions chart.但是,我正在使用自定义指标,它绘制在头寸图表的顶部。 can someone assist me?
有人可以帮助我吗? The indicator I am working with is proprietary, but any defined custom-indicator solution would be helpful.
我正在使用的指标是专有的,但任何定义的自定义指标解决方案都会有所帮助。
Here is my chart.Posn() call:这是我的 chart.Posn() 调用:
chart.Posn(Portfolio = strategy,
Symbol = tickers,
theme = myTheme,
Dates = "2016-01-20::2016-01-20",
TA = "add_TA(range_expansion_index(OHLC(mktdata)))")
and this is what my output looks like (i have highlighted the problem in the red box):这就是我的输出的样子(我在红框中突出显示了问题):
the solution that worked for me was the add_TA function.对我有用的解决方案是 add_TA 函数。 for example,
例如,
rei <- my_function(close_prices, period = 5)
chart.Posn(Portfolio = strategy_nm,
Symbol = tickers,
theme = myTheme)
add_TA(rei, col = "black", lwd = 1.5, legend = "REI", type = 'l')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.