altustro

Exponential Regression

altustro Cập nhật   
In Tradingview it is not possible to actually display arbitrary non-linear functions retrospectively.
Series objects can only depend on the current or past bars
Thus, while regression is possible, display of a non-linear curve into the past is not possible

This script is a workaround to be able to still display an exponential fit of the last n bars.
It is based on a linear regression of the log(close). The parameters of this regression are printed in the label.
To create the correct plot, these parameters have to be written into the properties of the indicator.
The functions displayed follow the expression exp(A)* exp(pot*t+d)
where d =0 for the center line, and d = +-std * upperMult for the upper and lower line respectiveley.
The parameters of the function are:
  • amplitude in log scale A
  • exponent of the exponential function pot
  • standard deviation of the linear regression std
  • number of bars of the current chart bindex
  • multiplicator of the std of the upper and lower exponential line upperMult and lowerMult +






This code is a version of the built-in "linear regression" script of Tradingview alztered by Forza so it can be plotted correctly on logarithmic charts
The code of Forza was further adjusted by altustro to be able to plot the full exponential curve also in regular scale

Phát hành các Ghi chú:
removed other indicators to give clear view.

moved stop loss (SL) / take profit (TP) and holding time tHold a little lower for better view
Phát hành các Ghi chú:
removed other indicators in chart
Phát hành các Ghi chú:
renamed and default length now 360
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 đồ?