polakowo / vectorbt

Find your trading edge, using the fastest engine for backtesting, algorithmic trading, and research.
https://vectorbt.dev
Other
4.28k stars 613 forks source link

Accessing current settings #412

Closed crazypythonista closed 6 months ago

crazypythonista commented 2 years ago

Hi, Am a newbie trying to get hold of this cool project. Am stuck at using the radom strategies generator with hyperparameters optimization.

Code to do so: n = np.random.randint(10, 101, size=3).tolist() pf = vbt.Portfolio.from_random_signals(price, n=n, init_cash=100, seed=42)

It's the same code which is present in the official page of vectorbt for demonstrating the Random generator feature. My objective is to get the hyperparameter's values and settings out. Any sort of help will be appreciated. Thanks.

polakowo commented 2 years ago

@Tasneem01 what kind of settings you want of extract? To get the generated parameters, you can run pf.total_return() and the parameters will appear in the index. Alternatively, you can see the parameters in pf.wrapper.columns.