Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centered moving average #3

Open
bfaure opened this issue Oct 24, 2018 · 2 comments
Open

Centered moving average #3

bfaure opened this issue Oct 24, 2018 · 2 comments
Labels

Comments

@bfaure
Copy link
Owner

bfaure commented Oct 24, 2018

Convert the plot simple moving average lines over to centered moving averages.

@kaashan
Copy link

kaashan commented Oct 26, 2018

I didn't quite understood this issue? Could you please elaborate more?

@bfaure
Copy link
Owner Author

bfaure commented Oct 26, 2018

Hey @kaashan , in the make_view_plot function of the popup_generator.js file the 7 and 50 day moving averages are currently calculated as simple moving averages (the 7 day moving average on day n is the average of the prices of the last 7 days). The goal is to implement a centered moving average so, for example, the 7-day moving average on day n is the average of views in the range [n-3, n+3] rather than [n-6,n]. The issue with this is that we'll need to either cut short our moving averages towards the end of the plot, or convert them over to simple moving averages once we run out of days pull data from. For example, if we let our number of days over which we average be M and the current true day be T, we won't be able to calculate the average for any time past (T-M/2), at this point you would need to convert over to a simple moving average for the rest of the plot. If you have any questions be sure to let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants