Simple_Xtrade

TrendVortex Power

This Pine Script indicator in TradingView creates weekly labels for each trading day (Monday to Friday) and generates buy/sell signals based on a swing calculation:

Weekday Labels
Purpose: Labels each trading day of the week with different colors.

Implementation:
Initializes variables for labels (mondayLabel, tuesdayLabel, etc.).
Uses dayofweek function to determine the current day of the week.
Checks if the current day is different from the previous day to avoid redundant label creation.
Creates labels using label.new function with appropriate colors based on the day of the week.

Buy and Sell Signals:
Purpose: Identifies buy and sell signals based on swing high and swing low points.
Implementation:
Uses a specified number of bars (no) to determine swing highs (res) and lows (sup).
Determines the direction (avd) based on whether the close is above the previous swing high or below the previous swing low.
Tracks the last non-zero direction change (avn).
Calculates the trailing stop loss (tsl) based on whether the direction is bullish or bearish.
Generates buy signals (Buy) when the close crosses above the trailing stop loss (tsl), and sell signals (Sell) when the close crosses below.

Alerts:
Purpose: Alerts are generated when buy or sell signals occur.

Implementation:
Uses alertcondition function to trigger alerts when Buy or Sell conditions are met.
Optional: Remove labels on weekends
Purpose: Prevents labels from appearing on weekends or non-trading days.
Implementation: Checks if the current day (dayOfWeek) is Saturday or Sunday, and deletes the labels (mondayLabel, tuesdayLabel, etc.) if true.

Summary:
This indicator provides visual and alert-based indications of buy and sell signals based on swing highs and lows, alongside labeling each trading day of the week in a distinctive manner. It's designed to assist traders in identifying potential entry and exit points based on these technical signals. Adjustments can be made to parameters such as the swing number (no) and color schemes to fit specific trading strategies or preferences.






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 đồ?