Strategy Premise
Heikin–Ashi, also sometimes spelled Heiken–Ashi, means “average bar” in Japanese. The Heikin–Ashi technique can be used in conjunction with candlestick charts when trading securities to spot market trends and predict future prices. It’s useful for making candlestick charts more readable and trends easier to analyze
Heikin Ashi is better for price action however we can get optimum results by using some filters like ema, rsi, volume, etc. Further, we will demonstrate the steps to automate the simple Heikin-Ashi strategy.
We can generated heikinashi values with a mathematical formula considering some of the previous candles values. There are two primary trade signals we can identify through the Heiken Ashi candlestick:
- Bullish candlesticks have no wicks or very small wicks. They indicate a strong uptrend and excellent buying opportunities.
- Small candlesticks can be characterize by a small body, big upper, and lower wicks. They signal a potential reversal.
Heikin ashi is better for price action however we can get optimum results by using some filters like ema, rsi, volume,etc. Further we will demonstrate the steps to automate simple heikin-ashi strategy.
Limitations on Heikin Ashi traditional charts:
- Trading view free/pro users cant access HA charts for intraday
- It shows wrong back testing results. When any strategy is applied on Heikin ashi it would show best profit curve but that’s unreal because heikin ashi has so much of variation from real market price
- It actually has chance to mislead people that heikin ashi is best always
Therefore we are going to setup an alternative heikin ashi strategy which can be applied on normal candlestick charts.
Advantages of Heikin Ashi strategy with normal candles over traditional:
- The price is related to real markets and logic is related to renko block building this strategy will reduce slippages when applied on real markets
- Trading view free users/pro users who cannot access renko charts can use this to apply renko on normal charts
Strategy Logic
Long Entry : when there is a cross over with Heikin Ashi candle and Ema +2 consecutive Heikin Ashi bullish candles Send LE
Long Exit: Either when SL or Target is hit. If SL/TGT is not hit or trend is reversed Send LX and SE
Short Entry: When there is cross under of Heikin Ashi value and Ema + 2 consecutive bearish candles Send SE
Short Exit: Either when SL or Target is hit. If SL/TGT is not hit or trend is reversed Send SX and LE
TradingView Settings
Step 1: Download the pinescript code from here.
STEP 2: Now open desired chart in trading view with normal candlestick. Select desired time-frame of the chart. Go to pine editor section, remove the default code, paste the downloaded code,save the file and add to chart.
STEP 3: Once strategy is applied on chart, click on settings to optimize parameters for your own trading.
- Moving average type(MATYPE): Simple moving average (SMA) , Exponential moving average(EMA)
- The Moving average length(MA LENGTH): length of moving average
- Moving average Source: source used for moving average calculation
- Trade intraday: check this option to make all trades based on intraday session
- INTRADAY SESSION: this will be trade session for intraday( works only if the previous option is checked)
- USE STOPLOSS : check this to use stoploss
- STOP LOSS: loss amount specified in Rupees (works only if the previous option is checked) Trade Quantity: Custom Trade quantity
STEP 4: Settings Alerts for Auto Trading with APIBridge. Just paste {{strategy.order.comment}} in alert window. That’s all, you are ready to trade!
Do you want coding help to deploy your own strategy for live trading? Check our coding assistance.
It worked. Need to add this before the code:
//@version=4
Great work sir you are really helping people like me who are learning with your help. Once again thanks.
Good work…but can u explain how to configure the said in api bridge software…means qty as per alert from trading view…. thanks
Hii Prem,
To make it clear about trading custom quantities,
If you specify quantity in api bridge that means that irrespective of the quantity sent from trading view alert the quantiy specified in Api bridge will be placed,
In our indicator we have option to trade custom quantities before using it just make sure that quantity column of the script is made empty
then go to settings and select quantity you want to trade and create the alert ..