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.
نص برمجي للمستخدمين المدعوين فقط
يمكن فقط للمستخدمين الذين تمت الموافقة عليهم من قبل المؤلف الوصول إلى هذا البرنامج النصي. ستحتاج إلى طلب الإذن والحصول عليه لاستخدامه. يتم منح هذا عادةً بعد الدفع. لمزيد من التفاصيل، اتبع تعليمات المؤلف أدناه أو اتصل Quantonomyfund مباشرة.
تجدر الإشارة إلى أن هذا النص البرمجي الخاص والموجه بدعوة فقط لم تتم مراجعته من قبل المشرفين على النص البرمجي، كما أن امتثاله للقواعد الداخلية غير محدد. لا توصي TradingView بالدفع مقابل برنامج نصي أو استخدامه إلا إذا كنت تثق تمامًا في مؤلفه وتفهم كيفية عمله. يمكنك أيضًا العثور على بدائل مجانية ومفتوحة المصدر في نصوص مجتمعنا.
تعليمات المؤلف
تحذير: يرجى قراءة دليلنا الخاص بالنصوص المخصصة للمدعوين فقط قبل طلب الوصول.
إخلاء المسؤولية
نص برمجي للمستخدمين المدعوين فقط
يمكن فقط للمستخدمين الذين تمت الموافقة عليهم من قبل المؤلف الوصول إلى هذا البرنامج النصي. ستحتاج إلى طلب الإذن والحصول عليه لاستخدامه. يتم منح هذا عادةً بعد الدفع. لمزيد من التفاصيل، اتبع تعليمات المؤلف أدناه أو اتصل Quantonomyfund مباشرة.
تجدر الإشارة إلى أن هذا النص البرمجي الخاص والموجه بدعوة فقط لم تتم مراجعته من قبل المشرفين على النص البرمجي، كما أن امتثاله للقواعد الداخلية غير محدد. لا توصي TradingView بالدفع مقابل برنامج نصي أو استخدامه إلا إذا كنت تثق تمامًا في مؤلفه وتفهم كيفية عمله. يمكنك أيضًا العثور على بدائل مجانية ومفتوحة المصدر في نصوص مجتمعنا.
تعليمات المؤلف
تحذير: يرجى قراءة دليلنا الخاص بالنصوص المخصصة للمدعوين فقط قبل طلب الوصول.