Marigold / universal-portfolios

Collection of algorithms for online portfolio selection
Other
772 stars 213 forks source link

error while running On-line portfolios.ipynb #32

Open ashraf-01 opened 4 years ago

ashraf-01 commented 4 years ago

hi all am getting the following error (RuntimeError: dictionary changed size during iteration) after running the following code list_result = algos.OLMAR.run_combination(yahoo_data, window=[3,5,10,15], eps=10)

is there any reason for that and can you help on that issue ?

am using python 3.7 (installed via anaconda packaging system ) on linux machine with18.04 ubuntu distribution

I noticed as well that you were using .IX instead of ILOC AND LOC functions within numpy and pandas

secondly , for one of these algos (OMLAR) is using the ratio type of prices by scaling them using the starting values , however in real situations , orders are issued to buy at the current available prices not at the scaled one , so how can I resolve that issue , shall I undo the scaling ? your input is highly appreciated

Marigold commented 4 years ago

Hey @ashraf-01, I've tried to replicate it but didn't get any error. Could you post a full example and full stack trace, please?

I noticed as well that you were using .IX instead of ILOC AND LOC functions within numpy and pandas

My bad, I was replacing them during the last upgrade but forgot a few. The new release should only use LOC and ILOC.

secondly , for one of these algos (OMLAR) is using the ratio type of prices by scaling them using the starting values , however in real situations , orders are issued to buy at the current available prices not at the scaled one , so how can I resolve that issue , shall I undo the scaling ?

These algorithms are not intended to be used in real trading. If you want to do so, the best approach is probably to take relevant chunks of code from this package and use them in some other framework.

ashraf-01 commented 4 years ago

THANKS I WILL POST A SCREEN SHOT OF THE ERROR VERY SOON , I HAVE A LOT OF FILES GOING AROUND , SO IT MIGHT BE THE CASE THAT I BETTER USE VIRTUAL ENVIRONMENT AND THEN REPEAT THE RUNNING OF THESE ALGOS INSTEAD OF MY BASE ENVIRONMENT , HAVE YOU UPGRADED ON YOUR COMPUTER ANY ONE OF THESE LIBRARIES AVAILABLE WITHIN THE requirments.txt file ?

Marigold commented 4 years ago

No. If you want to replicate it and be sure you have correct requirements you can use binder (see links here https://github.com/Marigold/universal-portfolios#resources)

ashraf-01 commented 4 years ago

GREAT DO YOU WORK FOR BINDER ?