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

2676 visualizzazioni
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.

Note di rilascio: 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.
Note di rilascio: The box adjustment was not working so well so removed it for now.
Note di rilascio: 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!
Rimuovi dagli script preferiti Aggiungi agli script preferiti


I recently added alerts to this script for the upper and max upper, lower and max lower trend lines. You can enable them by selecting the alerts tab option on the right menu bar then pressing the 'create alert' button or the + button above and then selecting my indicator from the 'condition' dropdown and then selecting the condition below it. If you need any help just let me know.
@x11joe, This indicator helps me a lot now! Many thanks for the additional features!
+1 Rispondi
x11joe mfa_supertrader
@mfa_supertrader, antime, let me know if you have any other ideas!
I want to note that this script works really well with the new oscillator partner script I created to go with this. It measures the pearson's R as it changed over time for the long term and short term trends. This helps avoid the need to use replay mode all the time to see these variations and changes.
Hi ... a great indicator, I hope that a copy will be available on MetaTrade
x11joe rafialife
@rafialife, I'm not familiar with MetaTrade, what is that? Do they let you post scripts also?
Very good script. Help me a lot
x11joe xaviermining
@xaviermining, Glad you liked it. What part is most useful to you? I'm working on some improvements to this and was curious what you think might help.
+1 Rispondi
I forgot to note that the script can be a bit slow so just have some patience for it to start, it has to do A LOT of calculations to figure this stuff out. You can speed it up a bit by changing the step-by parameter in the settings if necessary.
@x11joe, ok
Home Screener azioni Screener forex Screener cripto Calendario economico Come funziona Caratteristiche Grafico Costi Invita un amico Regolamento Centro di supporto Soluzioni per broker & siti web Widget Librerie grafiche Libreria grafica leggera Blog & Novità Twitter
Profilo Impostazioni profilo Account e fatturazione Invita un amico I miei ticket di supporto Centro di supporto Idee pubblicate Follower Seguiti Messaggi Privati Chat Esci