Replies: 3 comments
-
Can you assign the different symbols to their own variables and then run the variables through your function? Maybe set the function to run multiple different times with multiple different variables within the script? Similar experience so don't count on it but it makes sense to me. Might not be too efficient though haha |
Beta Was this translation helpful? Give feedback.
-
Also interested to know |
Beta Was this translation helpful? Give feedback.
-
The data must have one frequency, if your data has multiple then either resample them to the highest frequency (even though it would yield many nans but vbt is quite resistant to them) or do separate simulation for each set of data (unless your sets are interconnected in some way, in this case you should go the resampling path). The pro version has some functionality and an extensive tutorial on resampling both indicators and entire portfolios, just in case if you struggle with your own implementation. |
Beta Was this translation helpful? Give feedback.
-
Hi @polakowo,
First off thanks for this library you created, came across it on youtube and find the learning curve more manageable than backtrader. I'm a digital marketer by day, lost money in stocks (thought I'm a invester, but daytrader by urge lol) and still learning my way in python, so bear with my noob questions.
My use case:
Everyday my broker scanner shows me symbols by top % price increase. I'm able to pull intraday data from Polygon by time interval (like 1m bars...5m bars...15m bars...1h... etc). My script strategy looks at the 3m or 15m bars or 1h bars, and enters a position when the conditions fits.
I interpret VectorBT as basically requiring Close price / Entry / Exit columns along a time series index. I can provide the Close price using Polygon, and Entry / Exit true false columns using my own script. I did a simple backtest using a single symbol for a single set of start / stop date using 3m bars, and VectorBT gave me understandable results that tallies with my own script. I'm using "candles" as the dataframe name, with lots of lines before to get the price / entries / exits columns.
I'm having issues with these:
Looking through the discussions, the following seems to be the closest fit to my use case, but I'm unable to figure out each symbol having it's own start/stop dates with different intraday bars.
please advise!
Beta Was this translation helpful? Give feedback.
All reactions