I am a newbie for R and have got stuck here. I am trying to draw a graph with price, sma and ema.
When I call the graph from the command line it draws fine includin
wrap plot around your add* calls.
plot
plot(addSMA(10)) plot(addEMA(10))
I think you could also just add these in the lineChart call instead. (untested)
lineChart
lineChart(ydat.monthly["1998/"], TA="addSMA(10);addEMA(10)", name=paste(tickers[x],"Monthly & 10 Month Moving Average"))