Gentleman-Goat

Linear Regression - Auto Adjust To Ideal Pearson's R (Min & Max)

Gentleman-Goat Cập nhật   
This is meant as a partner to my linear regression strategy script. This one however is just the indicator only so you can overlay the technique over other strategies.

To use this script you need to understand what Pearson's R is; which is how correlated a set of data is to a line within a given deviation (+ or -).

If the Pearson's R is negative (-) then the trend is going upwards. If the value is positive (+) then the trend is going downwards.

There is a lot of debate as to what the ideal negative and positive values are for the Pearson's R, so you can change these in the settings. What the script will do is attempt to automatically find (and draw the trend lines) based on a given minimum period and a maximum period (both set in the settings) that match the ideal Pearson's R settings selected.

Ideally the data is MOST correlated the closest it is to -1 or 1. This means the pattern is very reliable.

This script was designed and works very well with the bar replay mode. You may need a more professional version of TradingView to use this correctly. This mode allows you to see the script in action as it mutates and changes according to the new data being introduced.

I've pre-set the Pearson's R (+) and (-) ranges to what I think is ideal.

Phát hành các Ghi chú:
This new version cleans up the code a bit and adds a better infobox thanks to richard santos and some modifications I did to his original code base. The colors of the info box are designed to better match the new oscillator partner script I uploaded as well.
Phát hành các Ghi chú:
The box adjustment was not working so well so removed it for now.
Phát hành các Ghi chú:
I changed the default values to 0.85 for both positive and negative to match the oscillator indicator. These can be changed in the settings. I also added alerts for the upper and upper max + lower and lower max trend lines. You can enable these alerts by going to alerts and adding a new alert then selecting my indicator and selecting from the alert options. Enjoy!
Phát hành các Ghi chú:
Added new alerts for detecting bullish,bearing or sideways trends that you can set and alerts for both the long term and short term when these occurs so users can use webhooks to trigger trades based on these conditions. Some traders like to trade differently during different cycles, so this will allow you to do this programmatically now :). Thanks to TradeBoneDog for this suggestion :).

You can disable what shows in the infobox as well in the settings if you only care about seeing certain results so it doesn't get so cluttered in there ;).

-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?