enzoampil / fastquant

fastquant — Backtest and optimize your ML trading strategies with only 3 lines of code!
MIT License
1.48k stars 236 forks source link

fix datetime format for getting intraday crypto data #381

Closed jannctu closed 2 years ago

jannctu commented 2 years ago

resolves #

Description

mikeejazmines commented 2 years ago

Hi @jannctu ! Thanks for your pull request and contribution, and apologies for the late revert. Could I just request that you run the steps in Step 5 of the Contributing docs?

You may need to download black, flake8, pytest, and tox if they aren't available

python -m pip install black
python -m pip install flake8
python -m pip install pytest
python -m pip install tox

Then you can follow the steps:

flake8 .
black .
pytest python/tests/test_fastquant.py
tox .

These are just automated steps to ensure standard formatting and checks before each pr is merged! :)

I ran it on my end and the pytests are failing due to them being static to a daily format DATE_START = "2018-01-01" DATE_END = "2019-01-01"

fastquant was also initially optimized for EOD/daily data so we could add a different variable for hourly which crypto will now rightfully support with your PR. A nice user experience would be that if a user wants EOD data they can add just YYYY-MM-DD and if they want intraday then add the HH:MM:SS, as requiring it for all would be a big change for the current users now. So it's more of adding additionally functionality compared to requiring a new format to be used.

Thanks again!

mikeejazmines commented 2 years ago

Hi @jannctu created and merged a PR of this https://github.com/enzoampil/fastquant/pull/396

Handled also the other possible cases (for example if they pass without any HH:MM:SS it should still work)

Hope this is good for you :)