-
Hi @edtechre @albertandking & pybroker community! Question and BackgroundI was wondering if there is a way to access the indicator & model prediction data / columns that the strategy class uses. Similar to the following providing a
I am asking because I would like to plot
My idea is to allow plotting for all 4 stages with only 3 and 4 requiring a backtest. For example I might want to plot only the basic data with the indicators, just to develop an indicator. Later in the development process I would like to run a backtest to develop trading rules and/or ML models. At this point I would like to not only see the trades but also the models prediction values that caused the trades. Currently I only know how to achieve 1. & 2. - can anyone tell me of a better way and/or tell me how to achieve 3. & 4.?
This gives me a simple dataframe to plot. By filtering for a specific symbol I could plot its price and some indicators. For 3. I assume I have to start from the following lines in the tutorial:
The last line in the code above ↑ seems to perform the training and testing, but obviously does not give any trades (which I dont need for stage 3. anyways as I just want to look at prediction values alongside the price). Could I extract the prediction values (for all symbols) from this line (somehow) or am I on the wrong track? What would be the best way to get the PlottingI am wondering if any of you have already developed plotting solutions for pybroker? Here´s what I am trying to do..I am using 1 minute bars and the only thing I found capable of plotting millions up to hundreds of millions of points is plotly-resampler. This works only for scatter plots, so I can show candlesticks only when the user has zoomed in enough for regular plotly to handle it. I am currenlty writing a dash app in order to display the data from 1. - 4. in my browser (but as mentioned I dont know how to access this data) My hope is that I will manage to get visualizations per symbol (showing price, indicators, prediction values & trades) as well as portfolio views. I find the plotting of backtesting.py and autotrader quite pleasing and am aiming for something similar. What are your thoughts on this? Im new to both coding & algotrading and would appreciate any help and/or comments. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Note, you can use the return_signals option to return bar data, indicator data, and prediction values. |
Beta Was this translation helpful? Give feedback.
Note, you can use the return_signals option to return bar data, indicator data, and prediction values.