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

implemented feature to get historic price trend of a stock over certain fixed time intervals. #24

Merged
merged 10 commits into from
Mar 7, 2021

Conversation

paul-antony
Copy link

Implemented feature to get historic price trend of a stock over certain fixed time intervals. This feature collects historic data like price and volume of the stalk over certain pre-defined period.

The pre-defined period are 1D, 5D, 1M, 3M, 6M, 12M.

This data can be used to visualise the latest trends in the stock.

@sdabhi23
Copy link
Owner

Hey @paul-antony this looks awesome! Can you also help out with writing test cases for this?

@paul-antony
Copy link
Author

Sure, I will try to write some test cases for it.

getPeriodTrend. made them into float and int.
They were string before.
test to check output dictionary keys are present for getPeriodTrend
The bug being json.load() in py3.5 cannot take byte stream, only string
@paul-antony
Copy link
Author

added some test and some slight modification to the code.

Modification
converted some of the output from string to int,float.
added an assert to check if its a valid stock

@paul-antony
Copy link
Author

@sdabhi23 is there anything else needed to be added to the code

@sdabhi23
Copy link
Owner

Hey @paul-antony, I was busy last couple of weeks and so haven't yet properly reviewed the changes. Am planning to review and merge the changes next weekend

@sdabhi23 sdabhi23 changed the base branch from master to dev March 7, 2021 09:09
@sdabhi23 sdabhi23 changed the base branch from dev to master March 7, 2021 09:10
@sdabhi23 sdabhi23 changed the base branch from master to dev March 7, 2021 11:06
@sdabhi23
Copy link
Owner

sdabhi23 commented Mar 7, 2021

@paul-antony have updated some parts of the functions and test cases. The reasoning for the same is as below:

  • Removed dependency on verifyScripCodes: The flag to download the scrip codes file is set to False by default. Hence, the calls to getPeriodTrend can fail if the user initializes the object in default manner. This can lead to unwanted confusion.
  • Dropped support for '1D' and '5D' time periods: For 1D and 5D, the vol and price values are not EOD, while for the rest of the time periods the values are of 00:00:00 on the given date. Combining them in a single method can lead to unwanted confusion.
  • Improved test cases: Please refer to the code to understand the changes

@sdabhi23
Copy link
Owner

sdabhi23 commented Mar 7, 2021

Contributes towards #3

@sdabhi23 sdabhi23 merged commit 2bd60b0 into sdabhi23:dev Mar 7, 2021
@sdabhi23 sdabhi23 mentioned this pull request May 13, 2021
sdabhi23 added a commit that referenced this pull request Jan 26, 2024
implemented feature to get historic price trend of a stock over certain fixed time intervals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants