google-research / timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
https://research.google/blog/a-decoder-only-foundation-model-for-time-series-forecasting/
Apache License 2.0
3.02k stars 227 forks source link

BTC price forecasting #78

Open 16bc opened 1 week ago

16bc commented 1 week ago

Not issue. Just share my results, to save your time. This lib does not suit for stock forecasting or something like that, but I tried 2fun :smiling_imp: I found out it good forecasting cyclic moving, but that's all. I experimented all day, changing all possible parameters. A results differs not enough from random to be useful. Some typical pictures below.

SOME PICTURES Red line have minimum difference 1st predicted point and last input point. Green is mean_outputs) ![2024-06-22_18-49](https://github.com/google-research/timesfm/assets/60779263/f7c3370f-ab2c-4f6c-8088-dbfa4939b96f) ![2024-06-22_18-20](https://github.com/google-research/timesfm/assets/60779263/1233b3a0-53d0-4a0e-ab99-1171d290d663) ![2024-06-22_18-25](https://github.com/google-research/timesfm/assets/60779263/c5799a8d-8bd4-4006-8301-5f06d1de8e7c) ![2024-06-22_18-27](https://github.com/google-research/timesfm/assets/60779263/dc6904b4-5882-447a-b0bc-e7186b6064be) ![2024-06-22_18-29](https://github.com/google-research/timesfm/assets/60779263/a7632128-c6ec-45f0-8c8c-0a269c85edd6) ![2024-06-22_18-30](https://github.com/google-research/timesfm/assets/60779263/a0e64047-0635-4069-8974-e8d12f4a5a9a)
sdmorrey commented 1 week ago

The purpose of a model like this isn't to get a precise price prediction. It's to anticipate trend changes before they happen.

The results as you say look quite random. However, that is partly because you appear to be asking the wrong question. The question you want to answer is, "Is it better at predicting than more accepted methods like SARIMA or Parabolic SAR?"

Is there any place that will allow you to use leverage to go long and short on BTC? If so, the graphs you show can let you know when it might be a good idea to change position.

Consider backtesting a strategy using 10x leverage that alternates between going long and short whenever the model predicts a trend change. For additional safety consider adding an exit on drought condition (leverage needs a trend, a drought is when the trend flattens out to the point your cost to keep the position open is equal to or exceeds the profit earned by holding the position open). You should do the same thing with other forecasting models and see what shakes out.

iyuner commented 4 days ago

Hi! Is it possible to share your running code? I don't find a good example to use timesfm.