PROTECTED SOURCE SCRIPT

Doji Detector- Alerts!



1. Purpose

The script identifies Doji candles, which are candlesticks with very small or negligible bodies and relatively large wicks. These patterns often indicate market indecision and can serve as potential reversal signals.

2. User Inputs

The script includes several customizable parameters to fine-tune the detection of Doji candles:
• wickRatioLimit: Defines the maximum allowable ratio between the sizes of the upper and lower wicks.
• Example: If the upper wick is no more than 1.5 times larger than the lower wick (or vice versa), the candle can be classified as a Doji.
• bodyColor: Specifies the color for the body of detected Doji candles.
• showMarker: Enables or disables the display of a visual marker (a triangle) below detected Doji candles.
• bodyToWickRatio: Sets the maximum ratio between the size of the candle’s body and the total length of its wicks.
• Example: A body-to-wick ratio of 0.5 means the body cannot be larger than 50% of the sum of the upper and lower wicks.
• alertOnDoji: Activates or deactivates alerts when a Doji candle is detected.

3. Detection Mechanism

The script calculates key components of the candlestick:
• Upper Wick: Difference between the high price and the larger of the open or close prices.
• Lower Wick: Difference between the low price and the smaller of the open or close prices.
• Body Size: Absolute difference between the open and close prices.

It then determines whether the candle qualifies as a Doji based on the following conditions:
1. The body size must be less than or equal to the specified fraction of the total wick size (bodyToWickRatio).
2. The ratio of the upper wick to the lower wick must not exceed the defined wickRatioLimit.

If both conditions are met, the candle is classified as a Doji.

4. Visual Features

The script provides visual indicators for detected Doji candles:
• Bar Coloring: The bodies of detected Doji candles are colored with the specified bodyColor (default is red).
• Markers: If enabled (showMarker = true), a green triangle is plotted below each detected Doji candle for easy identification.

5. Alerts

The script sets up alert conditions for detected Doji candles:
• If alertOnDoji is enabled, an alert is triggered whenever a Doji candle is detected.
• The alert message is customizable and displays “Doji Detected!” by default.

6. Use Case

This script is useful for traders who want to:
• Identify moments of market indecision (Doji patterns) automatically.
• Receive alerts to take appropriate trading actions based on these patterns.
• Highlight Doji candles on charts with customized colors and markers.https://www.tradingview.com/x/3wRPxPml/
Candlestick analysisChart patternsTrend Analysis

สคริปต์ที่ได้รับการป้องกัน

สคริปต์นี้เผยแพร่แบบปิดและคุณสามารถใช้มันได้อย่างอิสระ คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้แต่คุณจะไม่สามารถดูหรือแก้ไขซอร์สโค้ดได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

คำจำกัดสิทธิ์ความรับผิดชอบ