Boulder-Investment-Technologies / lppls

Library for fitting the LPPLS model to data.
MIT License
350 stars 108 forks source link

Can this module be used to minute data as well as daily data? #86

Open SpenceSidne08 opened 1 year ago

SpenceSidne08 commented 1 year ago

Hi As I mentioned in the title, I'd like to put some price minute data. But it seems not to work when I just put them in the module. If I can use this module to analyze minute data, could you tell me how to do it. Thank you for your effort and post. It's so cool module and always helpful.

Joshwani commented 1 year ago

Hi @SpenceSidne08, Thank you for the kind words. We should be able to apply the model to minutely data. Are you able to provide a sample of the data you are analyzing? I could create a proof of concept in a shared notebook. Best, Josh

SpenceSidne08 commented 1 year ago

Thank you Josh! Sure! This is the data. to_csv_out.csv

Joshwani commented 1 year ago

Here is an example https://colab.research.google.com/drive/1iDvGHyclOsHImQI4qRQNL3_xvmjxnc3D?usp=sharing The trick is to convert time to evenly spaced numbers over a specified interval via numpy's linspace function. You lose timestamps but these can be reversed after the model has been fit.

Also, it looks like you may be interested in antibubbles, the current package doesn't support antibubbles yet. However, if you fork the repo you can achieve antibubble fits by changing tc - t to t - tc in the lppls method.

SpenceSidne08 commented 1 year ago

Awesome! Thank you very much! It's a kind of technical but intelligent trick. If you don't mind it, could you show me how to adapt CMA-ES to the code above you sent me?