Gentleman-Goat

Linear Regression Pearson's R - Trend Channel Strategy

This script takes advantage of the Pearson's R attribute of the data set you provide.

Pearson's R attempts to find how correlated data is with a potential pattern. If the number is negative the correlation is upwards. If it's positive the correlation is downwards. Pearson's R can only be a number between -1 and 1. It should be impossible to ever reach -1 or 1 as that would be a perfect correlation.

This particular strategy involves using linear regression and Pearson's R to keep recalculating steps back from the current position until the Pearson's R reaches the desired amount. For example, in my experience I have found that 0.85 for as a buy point is very good as it means the trend is very reliable and solid. When the market tends to be bullish it tends to do so longer then when it's bearish.

Likewise when a downtrend is more real, I found that 0.71 for the negative Pearson's R value is ideal and gives the best results.

These can all be changed in the settings section (with the gear icon) next to when you set your results.

This strategy is really fun/useful to watch if you have the replay bar mode enabled for TradingView. This script supports this and all you have to do is go into the settings and enable realtime mode. Doing this you can actually see the trend lines change in realtime and comes in very handy for seeing long term reversals as you will see the Pearson's R value start to go down or up indicating the path it's going on.

WARNING: This script is very intensive on the processing power of your machine. If you find that it's to slow you may have to go into the settings of the script and adjust the 'step by' parameter so that it calculates a little faster. It won't be as accurate but it will be good enough. I feel I've optimized it with it's current setting as an example of what you want to aim for.

If there are any questions do no hesitate to message or ask me. I love feedback on the community for new features and ideas!

This works best with with XBTUSD on the 4 hourly chart. It does not seem to work well if you go below hourly or go above daily.

-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?