OPEN-SOURCE SCRIPT

Heikinisi Candle (With MA + Smoothing + Buy/Sell with Cooldown)

562
This custom Heikinisi Candle (With MA + Smoothing + Buy/Sell with Cooldown) indicator combines the advantages of Heikin-Ashi candles with the flexibility of multiple moving averages and smoothing options. The built-in buy/sell signals with cooldown functionality help traders avoid overtrading while capturing trend reversals and momentum shifts. Whether you're a day trader, swing trader, or long-term investor, this indicator offers powerful tools for analyzing price action and making informed trading decisions.

Note: Disable the regular candle to get better visualization.

Key Features:
Custom Heikin-Ashi Candles:

The core feature of this script is the Heikin-Ashi candles, which are known for smoothing price action and helping traders identify market trends more clearly.

Unlike traditional Heikin-Ashi, this version adjusts the Heikin-Ashi close based on specific price action patterns, including rejection signals and engulfing patterns.

The custom Heikin-Ashi open also incorporates momentum, adjusting dynamically based on recent price changes.

Price Action Measurements:

The indicator measures key price action components, including:

Body: The absolute difference between the open and close.

Candle Range: The total range from high to low.

Upper Wick: The distance from the highest price to the maximum of open or close.

Lower Wick: The distance from the lowest price to the minimum of open or close.

These measurements help detect bullish and bearish conditions, as well as price rejection signals.

Buy/Sell Signal Logic:

Buy Signal: Triggered when the Heikin-Ashi close is above the chosen moving average (MA1), with a cooldown period to avoid too frequent signals.

Sell Signal: Triggered when the Heikin-Ashi close falls below the MA1 after a buy signal has already been issued.

The cooldown period ensures that buy and sell signals are spaced apart by a specific number of bars, preventing excessive signal generation during periods of price consolidation.

Multiple Moving Averages (MA):

This script supports up to three customizable moving averages (MA1, MA2, MA3), each of which can be set to different types and lengths, including:

Simple Moving Average (SMA)

Exponential Moving Average (EMA)

Weighted Moving Average (WMA)

Volume Weighted Moving Average (VWMA)

Volume Weighted Moving Price (VWMP)

Least Squares Moving Average (LSMA)

Hull Moving Average (HMA)

Double Exponential Moving Average (DEMA)

Triple Exponential Moving Average (TEMA)

Users can adjust the length and type of each MA for tailored analysis.

Smoothing Options for MAs:

Users can smooth the output of MAs using various types of smoothing algorithms (SMA, EMA, LSMA, WMA, Gaussian) and a customizable length. This helps to reduce noise in the moving average lines and provides clearer signals.

Gaussian Filter (Advanced Smoothing):

A Gaussian Filter is available as a smoothing option for MAs. This filter reduces noise and makes the moving averages smoother, which can be particularly helpful in volatile or choppy markets.

Alerts and Visualization:

The script allows users to plot buy and sell signals on the chart with distinctive markers. A Buy Signal is shown below the bar with a lime green marker and text "Buy," while a Sell Signal is shown above the bar with a red marker and text "Sell."

Traders can also set up alerts based on the buy/sell signals to get notified in real time.

Indicator Configuration:
Heikin-Ashi Candle Configuration:

Automatically adjusts Heikin-Ashi candles based on rejection signals, engulfing patterns, and momentum. It uses custom formulas for the Heikin-Ashi open and close, making it more sensitive to price action than standard Heikin-Ashi candles.

Moving Averages (MA) Configuration:

You can select from multiple moving average types and lengths (MA1, MA2, MA3) for trend-following analysis.

Choose between SMA, EMA, WMA, VWMA, VWMP, LSMA, HMA, DEMA, and TEMA.

Smoothing Options:

Enable or disable smoothing for the moving averages.

Select from different smoothing types, including SMA, EMA, RMA, WMA, LSMA, and Gaussian.

Cooldown Period:

Control the number of bars that must pass before a new buy/sell signal is triggered. This cooldown period helps prevent excessive trading signals in quick succession.

How to Use:
Analyze Price Action with Heikin-Ashi Candles:

The custom Heikin-Ashi candles are ideal for spotting market trends, reversals, and price rejection. Use the candle patterns to gauge the market sentiment.

Use MAs for Trend Confirmation:

The moving averages (MA1, MA2, MA3) can help identify the prevailing trend. A price above a rising MA indicates an uptrend, while a price below a falling MA suggests a downtrend.

Trigger Buy and Sell Signals:

When the Heikin-Ashi close crosses above MA1, a buy signal is triggered.

When the Heikin-Ashi close crosses below MA1 after a buy signal, a sell signal is triggered.

The cooldown period ensures that signals are spaced out, preventing overtrading.

Use Smoothing for Clearer Signals:

If you are trading in a volatile market, you can use the smoothing options to make the MAs smoother and reduce noise.

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.