问题
For some reason I cannot add a ROC signal to a blotter chart. In the documentation it should be allowed. I want to create a new chart bellow with this indicator. Can someone help?
# plot performance for symbol
chart.Posn(strategy_AbsMom, Symbol = 'SPY', Dates = '1998::',theme=myTheme)
chart.Posn(strategy_AbsMom, Symbol = 'SPY', Dates = '1998::',theme=myTheme,
TA='addROC(n=lookback,col=4)')
回答1:
chart.Posn
uses chart_Series
(not chartSeries
) internally, so you have to use add_*
functions (not add*
). Here's an example of adding a simple moving average to a chart.Posn
chart:
require(blotter)
demo(amzn_test, ask=FALSE)
chart.Posn("amzn_port", "amzn", TA='add_SMA(n=5, col=4)')
来源:https://stackoverflow.com/questions/32549654/add-technical-indicator-to-chart-posn