Question

My problem is legends overlapped, how to solved it? Because the first RSI value over the second legend Name. Thanks.

library(quantmod)
getSymbols("AAPL")
chartSeries(AAPL,subset='last 6 months')
myRSI  <- newTA(RSI, Cl , legend.name='RSI', on = NA , col = 'brown')
myRSI(8, on = NA, maType = 'EMA', col = 'red')
myRSI(13, on = 3, maType = 'EMA', col = 'blue')
Was it helpful?

Solution

The legend seems to be slightly different when on=NA, so a kludgey work-around is to call the first myRSI with on=NA and legend="" before calling the two you actually want:

R> chartSeries(AAPL,subset='last 6 months')
R> myRSI(8, on = NA, maType = 'EMA', col = 'red', legend='')
R> myRSI(8, on = 3, maType = 'EMA', col = 'red', legend='auto')
R> myRSI(13, on = 3, maType = 'EMA', col = 'blue', legend='auto')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top