eiten icon indicating copy to clipboard operation
eiten copied to clipboard

Completely Rewritten as a Library

Open silvavn opened this issue 4 years ago • 3 comments

I have completely re-written the code as a library instead of writing a CLI. I did that because, in my humble opinion, it is more useful to use Eiten in data analysis by integrating it into pipelines and notebooks. Taking this approach, the next step would be making it a package and releasing it on PyPi.

Features:

  1. Eiten now gracefully ignores companies that does not fit the timeline size (in the future I would like to just fill the gaps) image

  2. We can now use any future estimator desired and compare its performance image image

  3. We can use any kind of covariance matrix calculation, including those from Scikit Learn image

  4. Portfolio weights are now normalized and correspond to percentages (we can just multiply by some number and output a portfolio) image

  5. Testing is now completely vectorized image image image

  6. And we can easily evaluate our portfolios image

Disclaimer: I haven't developed unit tests. I have changed the GA a bit. This is not finance advice (obviously).

silvavn avatar Sep 22 '20 06:09 silvavn

This is some excellent stuff @silvavn - do you mind running some tests just to make sure everything works. Someone else previously submitted a PR and said that they'd run all the tests. The code broke immediately after I merged the PR.

tradytics avatar Sep 23 '20 01:09 tradytics

Hi I've got this errore when testing your PR: Traceback (most recent call last): File "portfolio_manager.py", line 36, in <module> main() File "portfolio_manager.py", line 32, in main eiten.run_strategies() File "eiten.py", line 100, in run_strategies weights = p.generate_portfolio( File "./strategies/genetic_algo_strategy.py", line 34, in generate_portfolio top_genes = self.select(kwargs.sample_returns, initial_genes) File "./strategies/genetic_algo_strategy.py", line 80, in select returns = np.dot(return_matrix, transposed_gene) File "<__array_function__ internals>", line 180, in dot TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

ricnov avatar Sep 07 '22 09:09 ricnov