# Polynomial Time Trend Model

Hey guys,

Interested to hear your feedback on the following strategy:

This is based on an article I wrote here, all the code, and my rather messy latex can be found on the link.

I have always been interested in trying to predict the beginning of a large trend. And this is my attempt at doing so.

So basically I want to fit a polynomial time trend using least squares on a rolling window. I decided to use a 24 hour rolling window, in order the model is sensitive enough to pick up movements in time to take advantage of them.

An illustration is given below:

(I made these numbers up for illustrative purposes)

https://preview.redd.it/r9r1429qp4r51.jpg?width=512&format=pjpg&auto=webp&s=73cc60d0a6b198bda3a65749cf8298cbb81bf08f

So I want to fit a model on in-sample data (red line) and then extrapolate from that into the next few periods (black dashed line).

My decision making on entering trades is:

LONG

If predicted/close-1 > Long Threshold

SHORT

If predicted/close -1 < Short Threshold

The idea here is that a quadratic trend can be approximated by a large forward looking model implied percentage change.

The preliminary results are as follows:

BITCOIN

2% target and stop loss. with -+3% thresholds. Around 250 trades in 2 years. Look ahead = 2 periods

https://preview.redd.it/y04662z0r4r51.png?width=640&format=png&auto=webp&s=296d5a02c52b48c7c89e58c99225cb142e6808e4

For the 30 minute timeframe, I just doubled the lookback/look_ahead from 24 to 48 periods, & 12 to 24 respectively. All else held constant. Although on 30 min timeframe there were 306 trades.

https://preview.redd.it/pvlp5epsr4r51.png?width=640&format=png&auto=webp&s=65a5e165b931921a6b0490443489880dd6880cee

I even checked the 5 minute timeframe, in order to keep the lookback constant at 24 hours the parameter becomes : 12 * 24 = 288, and I chose the lookahead at 4 periods. The number of trades goes up quite alarmingly to 601. But the results still look quite good:

https://preview.redd.it/roijkjsts4r51.png?width=640&format=png&auto=webp&s=6ce7c03abbfd734109d86af5ce844e23ae259faa

Ethereum

The parameters for the following charts are exactly the same as Bitcoin above. I think I probably should have constrained the threshold a bit for Ethereum since it is so much more volatile in comparison to Bitcoin. Although I wanted to keep things constant as a sort of sanity check that I didn't overfit for Bitcoin.

https://preview.redd.it/qgqdo9z3t4r51.png?width=640&format=png&auto=webp&s=14f3a5e0418557a13e6474a8b347d4ed20ab9a31