Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Moving averages of the same stock

Hi guys,

need some help here.

I want to record the 50-day and 200-day moving average of Apple stocks(AAPL) in the same graph.

Here is the code i wrote:
record(aapl_mavg=data[symbol('AAPL')].mavg(50), aapl_mavg=data[symbol('AAPL')].mavg(200))

However, the error i got was that keyword argument was repeated.

Would really appreciate some help here.

Thank you guys in advance :)

1 response

Give them different names
record(aapl_mavg50=data[symbol('AAPL')].mavg(50), aapl_mavg200=data[symbol('AAPL')].mavg(200))