1

I have the same problem as: Add Technical Indicator to 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(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): enter image description here

micstr
  • 5,080
  • 8
  • 48
  • 76
jonnie
  • 745
  • 1
  • 13
  • 22

1 Answers1

1

the solution that worked for me was the add_TA function. 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') 
jonnie
  • 745
  • 1
  • 13
  • 22