thinh-vu / vnstock

A powerful Python library for getting rich data from the Vietnam Stock Market using just a few lines of code
https://vnstocks.com
Other
510 stars 132 forks source link

[Feat] Add MA calculate #62

Closed henchiyb closed 1 year ago

henchiyb commented 1 year ago

PR Description

We need a way to calculate the moving average of the specific time range, so I added this method to calculate moving average of a stock by close price get from stock_historical_data

Check list

How did I test it?

Local

Screenshots or Test results

calculate_moving_average('VNM', date.today().strftime('%Y-%m-%d'), 10)
=> 73530.0

Reviewer Considerations