AboZade1

Adjustable SMA with Comparative Analysis

Inputs for Customization:
SMA Period (smaPeriod): Defines the period over which the SMA is calculated. The default is set to 252 days, typically representing a trading year.
Comparison Symbol (comparisonSymbol): Specifies the ticker symbol of another instrument (e.g., SPY for the S&P 500 ETF) to compare against the current stock. This allows for a relative performance analysis.
Days Ago for Price Difference (daysAgo): Determines the number of days in the past from which to calculate the price difference, allowing for a historical comparison.


The label, displayed at the end of the chart, contains several pieces of information:

Symbol vs. SMA: Shows the percentage difference between the current stock's close price and its SMA, indicating whether the stock is currently trading above or below its average price over the specified period.

Symbol vs. Days Ago: Displays the percentage difference between the current close price and the stock's open price from the specified daysAgo, offering insight into the stock's performance over that period.

Open Price X Days Ago: Presents the stock's open price from the specified number of days ago, providing a reference point for historical price analysis.

Minimum Price: Calculates a theoretical minimum price based on the stock's open price a specified number of days ago, adjusted by the percentage difference observed in the comparison symbol over the same period. This offers a unique insight into how the stock's price could have moved in parallel to the comparison symbol.

Comparison Symbol vs. SMA & Days Ago: Similar to the stock's analysis, these lines show the comparison symbol's performance relative to its SMA and its percentage difference from the specified days ago, aiding in a relative performance analysis.
Mã được bảo vệ
Tập lệnh này được xuất bản mã nguồn đóng và bạn có thể sử dụng một cách tự do. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ. Bạn không thể xem hoặc sửa đổi mã nguồn.
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 đồ?