Closed SamoPP closed 2 years ago
As mentioned in a comment on your SO question:
Your signalForChartSeries only has data until 2005. Hence you get this error message; you are trying to plot data outside of your plot area (2018 and further). If you change the subset to 2000/2005 the last line will work, but the other lines will give you errors because of the same reason.
Thanks. This is really embarrassing... Of course the code should have been:
signalForTA <- indicator[which(signal)]
signalForChartSeries <- Cl(VIX)[index(signal)[which(signal)]]
Description
add_TA for main panel (on=1) does not work and returns error. It works for second panel (on=2). Please see log and code below.
Using add_TA just for second panel (on=1) by commenting out add_TA for panel (on=0) works and produces the graph.
Expected behavior
I expected that also black points would be plotted in first panel (on=1). Instead an error is thrown about NAs... See above.
Minimal, reproducible example
Session Info
I have also asked about this on StackOverflow: https://stackoverflow.com/questions/71614328/adding-points-to-main-panel-in-chart-series-fails-with-add-ta