vectorbt icon indicating copy to clipboard operation
vectorbt copied to clipboard

Dose this project will support some strategy optimize in the future ?

Open svjack opened this issue 4 years ago • 7 comments

it seems like this project mainly support parameters selection by stats or visualization in returns or plot. But it seems some other project support strategy optimize by algorithm like: https://www.freqtrade.io/en/latest/hyperopt/ What’s the difference in your point of view between freqfrade’s strategy optimize and your stats and plot methods, Can you tell me the merits and drawbacks each other ?

svjack avatar Feb 25 '21 15:02 svjack

hyperopt takes a function, a space of hyperparameters, and slowly searches for the best parameters in that space. It has the advantage of having different optimization algorithms such as Bayesian.

vectorbt lets you build arbitrary grids of hyperparameters and simulate all configurations at once, very fast. If you visited any of the notebooks you would see that vectorbt is able to do millions of backtests in a matter of minutes. So instead of doing some fancy optimization with hyperopt, I can simply test all combinations. But hyperparameter optimization is only one aspect of vectorbt, I still consider it a data science package; with it, I only need a few minutes to do an analysis that took me hours or even days with backtrader, freqtrade, etc.

PS. Both libs work perfectly together.

polakowo avatar Feb 25 '21 15:02 polakowo

hyperopt takes a function, a space of hyperparameters, and slowly searches for the best parameters in that space. It has the advantage of having different optimization algorithms such as Bayesian.

vectorbt lets you build arbitrary grids of hyperparameters and simulate all configurations at once, very fast. If you visited any of the notebooks you would see that vectorbt is able to do millions of backtests in a matter of minutes. So instead of doing some fancy optimization with hyperopt, I can simply test all combinations. But hyperparameter optimization is only one aspect of vectorbt, I still consider it a data science package; with it, I only need a few minutes to do an analysis that took me hours or even days with backtrader, freqtrade, etc.

PS. Both libs work perfectly together.

I think as your above represent, the proper usage of this project may lean towards a more general way. So i think more dynamic example should be added in this project. Such as some use parameters return summary to reduce search space (with some underlying features understand from the result) or dynamic strategy switch (use the parameters search results in different time range , use this lookup table , back to abstract some sense of timeseries pattern use correspond strategy will be more suitable) they will help user to use this project to train their understanding of dynamic market. Can you give me some suggestions about above usage in your project ?

svjack avatar Feb 26 '21 00:02 svjack

There are notebooks that show how to optimize per time frame, asset, and other dimensions. Then you can go further and reduce the space based on your optimization function. Each step should be done with the construction of a hyper-parameter grid, simulation, and calculation of the performance metric (this is the most generic vectorbt pipeline). Every other aspect is similar to hyperopt except that vectorbt performs tests all at once/in chunks rather than sequentially. I can’t provide a detailed example as I’m working on something else right now.

polakowo avatar Feb 26 '21 01:02 polakowo

There are notebooks that show how to optimize per time frame, asset, and other dimensions. Then you can go further and reduce the space based on your optimization function. Each step should be done with the construction of a hyper-parameter grid, simulation, and calculation of the performance metric (this is the most generic vectorbt pipeline). Every other aspect is similar to hyperopt except that vectorbt performs tests all at once/in chunks rather than sequentially. I can’t provide a detailed example as I’m working on something else right now.

Will you provide some in the future ?

svjack avatar Feb 26 '21 02:02 svjack

Yes, on a basic walk-forward optimization, in a few days.

polakowo avatar Feb 26 '21 02:02 polakowo

Yes, on a basic walk-forward optimization, in a few days.

It seems like portfolio management as https://blog.quantinsti.com/portfolio-management-strategy-python/ not implement in this project. https://nbviewer.jupyter.org/github/polakowo/vectorbt/blob/master/examples/PortfolioOptimization.ipynb seems not similar with it.

svjack avatar Feb 26 '21 08:02 svjack

What exactly is not implemented, and how is portfolio optimization not similar? Please be more specific.

polakowo avatar Feb 26 '21 09:02 polakowo