OPEN-SOURCE SCRIPT

Customizable Multi-Timeframe Doji with Ray and Editable Label

Script Overview
Script Name: Customizable Multi-Timeframe Doji Candle Levels with Ray and Editable Label

Purpose: This script helps traders identify significant price levels based on high timeframe Doji candles, allowing them to visualize key areas of support, resistance, entry, and exit. By plotting real-time Doji levels from higher timeframes directly on the current chart, traders can easily spot areas where market indecision or potential trend reversals have previously occurred, making these levels highly relevant for future price action.

How the Script Works
This script detects Doji candles on a selected higher timeframe (e.g., daily, weekly, monthly) and plots a ray at the Doji’s closing level on the current chart. The Doji candle formation, characterized by an open and close that are very close or equal, is often an indicator of market indecision. By identifying these Doji levels from high timeframes, the script provides traders with insight into where strong support and resistance zones may form.

The script continuously monitors and updates the Doji level based on the selected timeframe, ensuring that only the latest detected Doji candle is displayed on the chart, helping traders avoid clutter and focus on the most recent data.

Core Components and Calculations
1 Doji Detection Logic:

-The script calculates the Doji candle formation based on a small body percentage (defined by the C_DojiBodyPercent parameter) and relative symmetry in upper and lower shadows (defined by C_ShadowPercent and C_ShadowEqualsPercent).

-A Doji is considered valid when the open and close prices are nearly equal, and the shadows are symmetric within the defined parameters, indicating indecision.

2 Multi-Timeframe Data Retrieval:

-Using the request.security() function, the script fetches open, high, low, and close prices from the specified higher timeframe. It applies Doji detection logic to this higher timeframe data.
-barmerge.lookahead_on and barmerge.gaps_on ensure real-time updates, so the Doji level is immediately reflected on the chart when detected.

3 Ray and Label Plotting:

-When a Doji candle is detected on the selected timeframe, the script plots a ray at the Doji's close price, extending forward on the chart.

-Customizable options for the ray, including color, width, and style (solid, dotted, or dashed), help traders visually differentiate the Doji levels from other chart elements.

-An editable label can be positioned alongside the ray to denote the Doji level, with customizable text, color, background, and size to provide additional context.

4 Automatic Line and Label Management:

-The script dynamically deletes any previous ray and label when a new Doji is detected. This approach minimizes chart clutter and ensures that only the most recent Doji level from the higher timeframe is displayed.

Customization Options
1Timeframe Selection:
Users can choose any timeframe (e.g., hourly, daily, weekly, monthly) to display Doji levels based on their specific trading strategy.

2Ray and Label Appearance:
Ray: Customize color, width, and line style (solid, dotted, dashed) for better visibility and integration with the chart’s theme.
Label: Customize the label text, background color, text color, text size, and position (above, below, left, or right of the ray) for a personalized view.

How to Use This Script

1 Select the Target Timeframe for Doji Detection: Choose a high timeframe (such as daily or weekly) to view Doji-based support/resistance levels.

2 Set Custom Ray and Label Parameters: Adjust the visual aspects of the ray and label to align with your chart setup and make the Doji level stand out.

3 Interpretation of Doji Levels: Use the plotted Doji levels as potential support or resistance zones. Since Doji candles reflect market indecision, they often precede significant price reversals or strong continuation moves. By analyzing these levels, traders can:
- Identify key support/resistance zones based on historical market indecision.
- Set entry and exit levels around these zones to capitalize on potential reversals or
continuations.
-Spot confluence areas where the Doji level aligns with other indicators or technical patterns.

Recommended Chart Setup
For optimal clarity, use this script on a clean chart, free from overlapping indicators. This script is designed to work independently, so avoid layering multiple support/resistance scripts unless essential to avoid clutter. A clean chart helps ensure that Doji levels are readily visible, enabling a clear focus on significant levels relevant to your trading strategy.
Candlestick analysismultitimeframe

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?


Aussi sur:

Clause de non-responsabilité