OPEN-SOURCE SCRIPT
HA Daily Bias & EMA Setup

Disclaimer
This indicator is inspired by the trading concepts discussed by Animesh K in "Learn Dual Edge Trading and Mindset."
This indicator is an independent implementation of selected concepts and should not be considered an official version of his strategy.
Trading involves risk. This indicator is intended as a decision-support tool and does not guarantee profitable trades.
Indicator Objective
The purpose of this indicator is to combine:
Daily Heikin Ashi Trend Bias
34 EMA Dynamic Trend Levels
Entry Confirmation
Exit Confirmation
Trend Filtering
to provide a clean trend-following trading system.
The indicator attempts to keep traders aligned with the higher timeframe trend while using the current timeframe for entries.
Core Trading Logic
The strategy is built around two ideas:
Determine the higher timeframe market bias.
Only take trades in the direction of that bias.
Instead of predicting reversals, the indicator follows momentum.
Daily Heikin Ashi Bias
The indicator first checks the previous day's Heikin Ashi candle.
Bullish Bias
Previous HA Close > Previous HA Open
Market Bias = Bullish
Only LONG trades are allowed.
Bearish Bias
Previous HA Close < Previous HA Open
Market Bias = Bearish
Only SHORT trades are allowed.
Neutral
If neither condition exists,
No directional bias exists.
Daily Support and Resistance
The indicator plots:
Previous Daily HA High
Previous Daily HA Low
These become important reference levels for:
Support
Resistance
Trend continuation
Risk management
Green Dots
= Previous HA Low
Red Dots
= Previous HA High
EMA Setup
The indicator uses two separate EMAs.
EMA 1
Length: 34
Default Source:
High
Purpose:
Bullish confirmation.
EMA 2
Length: 34
Default Source:
Low
Purpose:
Bearish confirmation.
Long Entry Rules
A LONG signal appears only when all conditions are true.
Condition 1
Daily Bias = Bullish
AND
Condition 2
Previous candle crosses above EMA High
AND
Condition 3
Current candle closes above EMA High
If all three conditions are satisfied,
A LONG label is printed.
Long Exit
The position exits when
Previous candle crosses below EMA Low
AND
Current candle closes below EMA Low
EXIT label appears.
Short Entry Rules
A SHORT signal appears only when:
Daily Bias = Bearish
AND
Previous candle crosses below EMA Low
AND
Current candle closes below EMA Low
SHORT label appears.
Short Exit
Exit occurs when
Previous candle crosses above EMA High
AND
Current candle closes above EMA High
EXIT label appears.
Signal Filtering
The indicator contains a built-in state management system.
Possible states:
Flat
Long
Short
This prevents duplicate entries.
Example:
LONG
LONG
LONG
LONG
Instead, only the first LONG signal is displayed until an EXIT occurs.
Likewise,
SHORT
SHORT
SHORT
SHORT
Only one SHORT signal is displayed.
Historical Signals
Option:
Show Historical Signals
ON
Displays every historical signal.
OFF
Displays only the latest signal.
Useful for clean charts.
Dashboard
The dashboard displays:
Previous Day HA Bias
Bullish
Bearish
Neutral
and
Previous HA Support Level
User Inputs
EMA Settings
Setting Default
EMA Length 34
EMA High Source High
EMA Low Source Low
Style Settings
Option Description
Show Daily HA Levels Display previous HA High and Low
Show Historical Signals Display all signals
Filter Consecutive Signals Prevent repeated LONG or SHORT signals
Recommended Timeframes
The indicator works best on:
5 Minute
15 Minute
30 Minute
1 Hour
4 Hour
The Daily Heikin Ashi bias remains constant throughout the trading day while entries are generated from the selected chart timeframe.
Suggested Workflow
Step 1
Determine Daily Bias.
If Bullish
Only look for LONG trades.
If Bearish
Only look for SHORT trades.
Step 2
Wait for EMA confirmation.
Do not anticipate the signal.
Step 3
Enter only after the label appears.
Step 4
Allow the trend to continue.
Step 5
Exit only when the opposite EMA confirmation occurs.
Risk Management Suggestions
Although this indicator generates entry and exit signals, every trade should include predefined risk controls.
Common approaches include:
Risk a fixed percentage of account equity per trade (e.g., 1–2%).
Place a protective stop below the recent swing low for long trades or above the recent swing high for short trades.
Consider taking partial profits at predetermined risk-reward levels while allowing the remainder to follow the exit signal.
Avoid forcing trades when the market is range-bound or during unusually low liquidity.
Best Market Conditions
This indicator generally performs best in:
Trending markets
Strong directional momentum
Stocks, ETFs, Index Futures, and Forex pairs with sustained trends
It may generate more false signals during sideways or choppy markets.
Indicator Summary
Feature Description
Higher Timeframe Filter Previous Day Heikin Ashi Bias
Trend Filter 34 EMA (High) & 34 EMA (Low)
Long Entries Bullish bias + EMA breakout confirmation
Short Entries Bearish bias + EMA breakdown confirmation
Exits Opposite EMA confirmation
Daily Levels Previous HA High & Low
Dashboard Current Daily Bias and HA Support
Signal Filter Prevents duplicate consecutive signals
This indicator is inspired by the trading concepts discussed by Animesh K in "Learn Dual Edge Trading and Mindset."
This indicator is an independent implementation of selected concepts and should not be considered an official version of his strategy.
Trading involves risk. This indicator is intended as a decision-support tool and does not guarantee profitable trades.
Indicator Objective
The purpose of this indicator is to combine:
Daily Heikin Ashi Trend Bias
34 EMA Dynamic Trend Levels
Entry Confirmation
Exit Confirmation
Trend Filtering
to provide a clean trend-following trading system.
The indicator attempts to keep traders aligned with the higher timeframe trend while using the current timeframe for entries.
Core Trading Logic
The strategy is built around two ideas:
Determine the higher timeframe market bias.
Only take trades in the direction of that bias.
Instead of predicting reversals, the indicator follows momentum.
Daily Heikin Ashi Bias
The indicator first checks the previous day's Heikin Ashi candle.
Bullish Bias
Previous HA Close > Previous HA Open
Market Bias = Bullish
Only LONG trades are allowed.
Bearish Bias
Previous HA Close < Previous HA Open
Market Bias = Bearish
Only SHORT trades are allowed.
Neutral
If neither condition exists,
No directional bias exists.
Daily Support and Resistance
The indicator plots:
Previous Daily HA High
Previous Daily HA Low
These become important reference levels for:
Support
Resistance
Trend continuation
Risk management
Green Dots
= Previous HA Low
Red Dots
= Previous HA High
EMA Setup
The indicator uses two separate EMAs.
EMA 1
Length: 34
Default Source:
High
Purpose:
Bullish confirmation.
EMA 2
Length: 34
Default Source:
Low
Purpose:
Bearish confirmation.
Long Entry Rules
A LONG signal appears only when all conditions are true.
Condition 1
Daily Bias = Bullish
AND
Condition 2
Previous candle crosses above EMA High
AND
Condition 3
Current candle closes above EMA High
If all three conditions are satisfied,
A LONG label is printed.
Long Exit
The position exits when
Previous candle crosses below EMA Low
AND
Current candle closes below EMA Low
EXIT label appears.
Short Entry Rules
A SHORT signal appears only when:
Daily Bias = Bearish
AND
Previous candle crosses below EMA Low
AND
Current candle closes below EMA Low
SHORT label appears.
Short Exit
Exit occurs when
Previous candle crosses above EMA High
AND
Current candle closes above EMA High
EXIT label appears.
Signal Filtering
The indicator contains a built-in state management system.
Possible states:
Flat
Long
Short
This prevents duplicate entries.
Example:
LONG
LONG
LONG
LONG
Instead, only the first LONG signal is displayed until an EXIT occurs.
Likewise,
SHORT
SHORT
SHORT
SHORT
Only one SHORT signal is displayed.
Historical Signals
Option:
Show Historical Signals
ON
Displays every historical signal.
OFF
Displays only the latest signal.
Useful for clean charts.
Dashboard
The dashboard displays:
Previous Day HA Bias
Bullish
Bearish
Neutral
and
Previous HA Support Level
User Inputs
EMA Settings
Setting Default
EMA Length 34
EMA High Source High
EMA Low Source Low
Style Settings
Option Description
Show Daily HA Levels Display previous HA High and Low
Show Historical Signals Display all signals
Filter Consecutive Signals Prevent repeated LONG or SHORT signals
Recommended Timeframes
The indicator works best on:
5 Minute
15 Minute
30 Minute
1 Hour
4 Hour
The Daily Heikin Ashi bias remains constant throughout the trading day while entries are generated from the selected chart timeframe.
Suggested Workflow
Step 1
Determine Daily Bias.
If Bullish
Only look for LONG trades.
If Bearish
Only look for SHORT trades.
Step 2
Wait for EMA confirmation.
Do not anticipate the signal.
Step 3
Enter only after the label appears.
Step 4
Allow the trend to continue.
Step 5
Exit only when the opposite EMA confirmation occurs.
Risk Management Suggestions
Although this indicator generates entry and exit signals, every trade should include predefined risk controls.
Common approaches include:
Risk a fixed percentage of account equity per trade (e.g., 1–2%).
Place a protective stop below the recent swing low for long trades or above the recent swing high for short trades.
Consider taking partial profits at predetermined risk-reward levels while allowing the remainder to follow the exit signal.
Avoid forcing trades when the market is range-bound or during unusually low liquidity.
Best Market Conditions
This indicator generally performs best in:
Trending markets
Strong directional momentum
Stocks, ETFs, Index Futures, and Forex pairs with sustained trends
It may generate more false signals during sideways or choppy markets.
Indicator Summary
Feature Description
Higher Timeframe Filter Previous Day Heikin Ashi Bias
Trend Filter 34 EMA (High) & 34 EMA (Low)
Long Entries Bullish bias + EMA breakout confirmation
Short Entries Bearish bias + EMA breakdown confirmation
Exits Opposite EMA confirmation
Daily Levels Previous HA High & Low
Dashboard Current Daily Bias and HA Support
Signal Filter Prevents duplicate consecutive signals
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.