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
Market profile indicator #5891
Market profile indicator #5891
Conversation
- TimeProfile and VolumeProfile created and tested. - tp_datatest.csv and vp_datatest.csv extracted from https://github.com/bfolkens/py-market-profile
All unit test made it and the indicator is passing all of them Test cases made it with python library from GH issue
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.
Nice work @Marinovsky! Great first PR 🙌
Leaving some requests and some code styling request changes
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.
Nice one!
Leaving minor comments and as final request suggest testing it in the cloud and charting the indicators values in a plot with an assets price and volume as a final graphical sanity test. Let's add those chart images into the PR description too 👍
Great work and timely too --there is an effort currently underway to add VolumeProfile to Lean, but it seems like you beat us to it, @Marinovsky! :) Question: is the histogram data easily accessible? Specifically, I'd like to be able to detect the shape of the volume profile distribution, and would need to be able to inspect the data in order to do so. See attached image for example of 'shape'. I aim to detect this by measuring skewness, kurtosis, mean, median and mode. Thanks for this good work! |
Hi @ikamanu, thanks for your question! Regarding your question: sure, the histogram data is accessible, the method |
Description
Two Market profile modes implemented: TimeProfile and Volume Profile.
Related Issue
Closes #4770
Motivation and Context
Market Profile reveals several factors that provide you with
an idea of the trading activity taking place in the markets.
Monitoring the market action will enable you to determine
the type of day that is developing, whether a price trend has
started, what the value area is, the type of activity (initiative
or responsive) taking place, whether the activity is continuing
or changing from the previous day, and whether the market is
trending or bracketing.
Requires Documentation Change
These changes will require updates to the indicators documentation, showing the new indicator and explaning how it works and the parameters need it.
How Has This Been Tested?
Using a Google Collaborative notebook (https://colab.research.google.com/drive/16oMViM6SwK4FRGTztxH23xgEE1QH0d23?usp=sharing) and the Python Market Profile library shown in the issue with IBM historical prices from 02/01/2020 to 31/01/2020 from Yahoo finance it was calculated the Market Profile with TPO (Time Price Opportunity) and VOL(Volume Profile) modes while manually rolling a period of three. Then those values were appended into two .csv files with the IBM historical prices previously mentioned, those files are called tp_datatest.csv for TimeProfile tests and vp_datatest.csv for VolumeProfile tests. Finally, using TestIndicator from TestHelper it was made an assertion for each Market Profile value in each mentioned mode.
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>
Final graphical sanity tests
IBM Volume Profile in January 2020 with a period of 3 days. Link: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_dfcca7b9a96cf6c60b3353115e919bcb.html
IBM Volume Profile from January first to June first of 2020 with a period of 15 days. Link: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_981f843cabd2a93e8daac76de830e532.html
IBM Time Profile in January 2020 with a period of 3 days. Link: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_6a86e887054c8b4c32a89f62f9148f0a.html
IBM Time Profile from January first to June first with a period of 15 days. Link: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_2502126741241ced2aff0274b4870171.html