Gentleman-Goat

Function Polynomial Regression Strategy

Gentleman-Goat アップデート済   
To be clear I'm using the code from Richard Santos for the functional polynomial regression. I really loved his script idea (given that I'm into linear regression myself). I took his code and made a strategy which applies to bitcoin on the 5 minute chart (but you could adjust this for any asset), and you could make this work on anytime frame by adjusting the 'length' property of the regression until you get good results.

This strategy is very simple.

I drew lines to represent the bottom most part of the regression (green line), and top most part (red line). If the close crosses under the red line then you short. The reverse if it crosses above the green line then you go long.

Very simple but effective. To understand this script be sure to add Richard santos function polynomial regression so you can see what is going on and what I'm trying to do.

For example, on BTC with a length of 61 if you bought and held you would have only had 5% gain, instead with this strategy you are looking at very close to 60% gains! Now this could be a weird fluke of over-optimizing but I'm not sure this is the case because you can adjust the length from there +/- about 10 and still have good results. It's just certain lengths are the correct trading rhythms for different assets.

I'm excited to see how you guys use this and if you have any success. Be sure to thank Richard Santos for his great work!
リリースノート:
I added trailing stop loss as requested by some users just enable it in the settings with the gear icon. By default I have it turned off, but with ETHUSD you can see that it can create improvements with the right settings. Just tweak it until you find the right settings.
リリースノート:
I added backtest date range and the ability to:

- Do only LONGS
- Do only SHORTS
- Close instead of Short
- Close instead of Long

In the example uploaded, you can see that by turning off allowLongs, and enabling close instead of long you can see how effective this strategy is with just shorting alone. Using this you can optimize your parameters for just shorting or longing and then combine them later for the best settings.

Thanks to investCHK for the suggestion!

-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?