Adaptive Power Law Fitting by Dr. G. Santostasi

The BTC Power Law Model creates a linear fit by assuming a power law relationship between the Price and time (measured in days from the Genesis) block and therefore uses the log of the price and the log of time (that is rarely used in financial analysis) to perform the regression calculation. It turns out that this unusual but simple approach represents a surprisingly good long-term approximation of the BTC price (with an R^2=0.95).
While Dr. Santostasi is the creator of the model other Pinescripts exist using the methodology borrowed from his work. Dr. Santostasi inspected the code of these scripts and they are incorrect or they use a static formula for the fitting instead of doing the regression in real time based on current data. This is why this current script is called "adaptive".
It uses current data, cleans the data of large outliers using several statistical methods and creates an online robust fitting in the log-log space. It is also adaptive because instead of being only valid on a daily bar time frame it can be used at all time frames (even if daily is ideal).
The other existent scripts cannot be used in this way because they use a static method designed only for the daily time frame.
Another innovation of the current script is to identify deviation levels from the trend that are based on sound statistical methods. A log-normal distribution of the residuals is assumed (based on the actual distribution of the BTC deviations). These distributions then it is then used to determine possible resistance and support levels at the relevant scale chosen by the user.
The script also contains other relevant information like previous and the next halvings.
Furthermore, the script projects the prediction of the model to the future (again missing from most existing PL scripts) several bars in the future selected as a parameter by the user.
The BTC Power Law Model creates a linear fit by assuming a power law relationship between the Price and time (measured in days from the Genesis) block and therefore uses the log of the price and the log of time (that is rarely used in financial analysis) to perform the regression calculation. It turns out that this unusual but simple approach represents a surprisingly good long-term approximation of the BTC price (with an R^2=0.95).
While Dr. Santostasi is the creator of the model other Pinescripts exist using the methodology borrowed from his work. Dr. Santostasi inspected the code of these scripts and they are incorrect or they use a static formula for the fitting instead of doing the regression in real time based on current data. This is why this current script is called "adaptive".
It uses current data, cleans the data of large outliers using several statistical methods and creates an online robust fitting in the log-log space. It is also adaptive because instead of being only valid on a daily bar time frame it can be used at all time frames (even if daily is ideal).
The other existent scripts cannot be used in this way because they use a static method designed only for the daily time frame.
Another innovation of the current script is to identify deviation levels from the trend that are based on sound statistical methods. A log-normal distribution of the residuals is assumed (based on the actual distribution of the BTC deviations). These distributions then it is then used to determine possible resistance and support levels at the relevant scale chosen by the user.
The script also contains other relevant information like previous and the next halvings.
Furthermore, the script projects the prediction of the model to the future (again missing from most existing PL scripts) several bars in the future selected as a parameter by the user.
Script su invito
Solo gli utenti autorizzati dall'autore hanno accesso a questo script e ciò richiede solitamente un pagamento. Puoi aggiungere lo script ai tuoi preferiti, ma potrai utilizzarlo solo dopo aver richiesto l'autorizzazione e averla ottenuta dal suo autore - per saperne di più leggi qui. Per maggiori dettagli, segui le istruzioni dell'autore qui sotto o contatta direttamente Quantonomyfund.
Si noti che questo script privato, ad invito, non è stato esaminato dai moderatori e la sua conformità con il Regolamento non è stata accertata. TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.
Declinazione di responsabilità
Script su invito
Solo gli utenti autorizzati dall'autore hanno accesso a questo script e ciò richiede solitamente un pagamento. Puoi aggiungere lo script ai tuoi preferiti, ma potrai utilizzarlo solo dopo aver richiesto l'autorizzazione e averla ottenuta dal suo autore - per saperne di più leggi qui. Per maggiori dettagli, segui le istruzioni dell'autore qui sotto o contatta direttamente Quantonomyfund.
Si noti che questo script privato, ad invito, non è stato esaminato dai moderatori e la sua conformità con il Regolamento non è stata accertata. TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.