SMA Calculation?

Very basic question but how do we go about calculating live SMA values correctly ourselves given we can access the current price of a stock at any interval (I’m using polygon.io)? Suppose I want a SMA with a period of 9. I tried getting the mark prices every second and then (once I had at least 9) did a rolling average calculation with a period of 9. However, when I plot my price vs SMA calculation, it doesn't look like the SMA with a period of 9 reported on TradingView or inside TD Ameritrade/ToS's SMA live technical chart. Any suggestions?

Submitted October 14, 2020 at 01:47PM by codininja1337
via https://ift.tt/2H29ES6

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s