INVITE-ONLY SCRIPT

Simple Xtrade Weekly Trend

44
Indicator Name:
Simple Xtrade Weekly Trend

Overview:
This indicator determines the market’s weekly trend direction by comparing the closing price of the current candle with the previous candle on a custom timeframe (default is Weekly). It uses this comparison to identify whether the trend is bullish or bearish and provides signals accordingly.

Core Functionality:

Custom Timeframe Input:
The script allows you to select any timeframe (default is "W" for Weekly) to determine trend direction.
This enables flexibility depending on whether you want to align with weekly, daily, or even monthly trends.

Percentage Price Difference Calculation:
It calculates the percentage difference between the current and previous candle closes on the selected timeframe.
Formula:
(current close - previous close) / previous close

Trend Direction Logic:
If the percentage change is greater than a user-defined threshold, the market is considered bullish.
If the percentage change is less than the negative threshold, the market is considered bearish.
If the change is within the threshold range, the trend direction remains the same as the previous state (persistent logic).

Trade Entry Logic:
Bullish Condition:
When the percentage change is greater than the threshold, the indicator triggers a long entry signal labeled:
"WEEKLY TREND - BULLISH"

Bearish Condition:
When the percentage change is below the negative threshold, the indicator triggers a short entry signal labeled:
"WEEKLY TREND - BEARISH"

The persistent buying variable ensures the trend holds unless clearly invalidated by a significant opposite move.

Practical Use:
Designed for trend-following strategies, especially useful for:
Aligning intraday trades with higher-timeframe trends.
Avoiding counter-trend trades.
Gaining a clear directional bias at the start of each trading week.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.