OPEN-SOURCE SCRIPT

Pattern Entry with Toggles - Clean

104
This script detects various candlestick patterns on a chart and marks potential entry points when certain conditions are met.

Script Contents:
1. Trend Filter (EMA)
Calculates an exponential moving average (EMA) with an adjustable period (emaPeriod).
Determines whether the market is currently trending up (isUptrend) or down (isDowntrend).
2. Pattern Detection (variable activation)
There are settings to individually activate or deactivate patterns for long (buy) and short (sell) positions:
Long Patterns: Bullish Engulfing, Morning Star, Hammer, Doji
Short Patterns: Bearish Engulfing, Evening Star, Shooting Star, Doji
3. Pattern Detection:
Automatically defined conditions to detect the respective candlestick patterns, e.g.:
Bullish Engulfing: Small red candle followed by a large green candle that "envelops" the previous one.
Morning Star: Third pattern that signals an uptrend.
Doji: Very small candle that indicates uncertainty.
The same applies to the short pattern variants.
4. Signal Generation:
If a pattern is detected and the trend direction is correct, a potential entry price (entry price) is set.
The whole process is limited to at least 5 bars (minBars) to avoid signals that are too close together.
5. Visualization:
Draws a marker ("Entry") on the chart for each valid signal, with the color corresponding to long or short.
What can you adjust in the settings (on/off switch)?
You can individually specify the following in the inputs:

Pattern Function Default Value
Enable Bullish Engulfing Enable for long entries true
Enable Morning Star Enable for long entries true
Enable Hammer Enable for long entries true
Enable Doji Enable for long entries true
Enable Bearish Engulfing Enable for short entries true
Enable Evening Star Enable for short entries true
Enable Shooting Star Enable for short entries true
Enable Doji (Short) Enable for short entries true
If you set one of these options to false, this pattern will no longer be considered when generating signals, regardless of whether it is present or not.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.