-
Notifications
You must be signed in to change notification settings - Fork 41
+ Weighted Moving Average #43
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
Conversation
| data = data.sort_by { |row| row[date_time_key] } | ||
| output = [] | ||
| period_values = [] | ||
| previous_wma = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| data = data.sort_by { |row| row[date_time_key] } | |
| output = [] | |
| period_values = [] | |
| previous_wma = nil | |
| data = data.sort_by { |row| row[date_time_key] } | |
| output = [] | |
| period_values = [] | |
| previous_wma = nil | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as per request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I even added back the empty line after line 61 so as to be consistent with Ema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some minor style (use blank lines to separate blocks of code (do..end, etc). I think scrambling the data order of the incoming data (in the rspec test) will also ensure that it's sorting properly when it comes in.
Otherwise, looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @thoran!
No description provided.