TradingView
PHVNTOM_TRADER
25 oct. 2022 20:47

RF+ Replay for Heikin Ashi 

Ethereum / TetherUSBinance

Description

RF+ Replay for Heikin Ashi

RF+ Replay for Heikin Ashi generates fully customisable Heikin Ashi candlesticks presented on a standard chart, enabling traders to utilise the Tradingview Replay feature with Heikin Ashi candlesticks when analysing and backtesting HA style strategies.

The features of this indicator include:

- Fully customisable Heikin Ashi Candles, including custom colour options for candle bodies, borders and wicks.
- Optional real-time, real-price close dots painted onto each candlestick.
- A optional set of 2 x Range Filters designed to indicate short term trend identification upon color change, ideal for low timeframe scalping.
- A optional set of 3 x fully customisable Moving Averages.
- An option to enable Heikin Ashi calculated data for the Range Filters and Moving Averages, so they present as they would on a Heikin Ashi non-standard chart type, without having to use an actual Heikin Ashi chart. Enabled by default.
- An optional sessions indicator, to highlight your prefered trading session for the purpose of backtesting.
- An optional watermark featuring customisable text and well as symbol and timeframe information, as seen in the screenshot of this indicator.

Instructions for use:

1) Because this indicator generates candlesticks and presents them onto your chart, you will need to hide the existing candlesticks so you do not see two sets of candles. You can do this by going into your Tradingview chart settings and making the candle bodies, borders and wicks fully transparent. You can then save this as a layout template. You can access your Chart Settings by clicking on the cog icon, or by right clicking on the chart itself and selecting 'Chart Settings' from the list.
2) Ensure you have the standard chart type selected - you do not need to select a Heikin Ashi type chart.
3) You will now be able to analyise and even backtest your Heikin Ashi style strategies including the use of the Tradingview Replay feature found at the top of the chart.


Heikin Ashi means 'average bar' in Japanese, which speaks to the fact that Heikin Ashi candles are calculated differently to standard Japanese candlesticks. The general idea of Heikin Ashi candles is to 'smooth' the appearance of price movement, by the use of averages within their calculation. It is important to understand that the Open and Close values of a Heikin Ashi candlestick do not reflect real Open and Close prices. You can use the real price dots feature to clearly see the real time and real price Close of each candle.

The formula for calculating a Heikin Ashi candlestick is as follows:

High = Maximum of High, Open, or Close (whichever is highest)
Low = Minimum of Low, Open, or Close (whichever is lowest)
Open = Open (previous bar) + Close (previous bar) /2
Close = (Open + High + Low + Close) / 4


If you found this useful, be sure to leave a like, comment and subscribe to show your support.

Until next time.

Notes de version

- Updated chart image

Notes de version

- Disabled the watermark text by default.

Notes de version

- Disabled 'Show sessions' option and also unselected the New York session to remove the background color by default.

Notes de version

- Removed unused code.

Notes de version

- Corrected the RF and Moving average to use the 'Use Heikin Ashi formula' option instead of the 'Show Heikin Ashi candles' option to convert them to a HA formula OHLC source.
- Refactored the switch function that converts to Heikin Ashi source types to only convert Open and Close values which are different for potential optimisation.
- Altered the border colour of the candle bodies to a slightly darker colour which gives them a more crisp, less blurry appearance.

Notes de version

- Adjusted HA source type conversion function to use all HA OHLC values, used by the Range Filters and Moving Averages.

Notes de version

- Fixed a bug whereby the candle wicks would fail to print after a time when using replay mode, by limiting use of request security function.
- Set real price close dots to disable by default.

Notes de version

- Updated the 2x Range Filters to use the request security source OHLC values

Notes de version

- Enabled the watermark text by default to make its purpose more obvious, symbol info at bottom of chart also now enabled by default.

Notes de version

- Added separate colour and linewidth styling options for each Range Filter, so each of the two Range Filters can be styled independently.

Notes de version

- Increased the width of the slow Range Filter and reduced the width and opacity of the fast Range Filter.

Notes de version

- Removed the current date from the watermark symbol info
- Reorganised settings menu
- Adjusted colours

Notes de version

- Reorganised settings menu
- Adjusted the candle border colour.

Notes de version

- Added global controls to top of settings menu for quick access.

Notes de version

- Minor modification to settings menu.

Notes de version

- Reintroduced the real-price line, so this can be used as a indicator bundle, as well as for using Replay mode.
- Added MTF moving average levels, defaulted to 144ema on 3m, 5m and 15m. Disabled by default.
- Adjusted 144ema and MTF moving average colour to orange.
- Added a couple of global toggle settings for the moving ave., MTF moving ave., and the sessions.

Notes de version

- Adjusted default colours.

Notes de version

- Added sizing options for the real price close dots.
- Updated the default colours for the real price line and real price close dots.
Commentaires
Blissful_Fall
Hey Tvenn, absolutely wonderful indicator! I was just wondering if their is a possible solution to the disappearing candles? I notice after a few minutes the candles tend to just completely vanish only in replay. The only way to get them to reappear is to re-apply the indicator itself.
PHVNTOM_TRADER
@Blissful_Fall, Hey sorry to keep you.
I've tried a few workarounds, it uses the built-in function for printing them, I will look back at it again when I get a chance and see if I can resolve.
I wonder if it is merely because the indicator is doing a bit too much, with serveral things bundled into one
Mike97438
Thank you for your indicator. It will be very useful
BassBass
Great script!! Thanks bro
jadhav22
Thanks Bro! Trying this indicator. Very less Heikin Ashi indicators. Need more!
PHVNTOM_TRADER
@jadhav22, 🙏
modhelius
Nice work!

A little tip though. Since some symbols does not have Heikin Ashi data on all timeframes (ie. OMXSTO:INVE_B does not have Heikin Ashi data on the 1h timeframe and below before January 1 2015) it would be better to use the standard symbol data to calculate the bars instead of relying on the underlying Heikin Ahsi data.

In other words, if you change the code into this instead the bars will work even if there is no underlying Heikin Ashi data:

haTicker = ticker.standard(syminfo.tickerid) // Notice that I here load the standard ticker rather than the Heikin Ashi ticker

[initO, initH, initL, initC] = request.security(haTicker, timeframe.period, [open, high, low, close])

haC = (initO + initH + initL + initC) / 4
haO = float(na)
haO := na(haO[1]) ? (initO + initC) / 2 : (nz(haO[1]) + nz(haC[1])) / 2
haH = math.max(initH, haO, haC)
haL = math.min(initL, haO, haC)

(I guess this code will probably also be a bit faster since it will only need to load the underlying ticker once instead of four times)
PeteyMoney
I love you.
WEGR
Dear @tvenn , is there any reason why your RF+ replay candle won't print further back? The RF+ replay indicator does not show any data starting from January 1st 2022 on the 30 minute time frame. I can't backtest 2018 until 2022 because it shows no candles.

I really hope hearing from you and look forward to you fixing the issue. Your indicator is kickass.

Is there someone else with this problem?
bhushanshevade
somehow its not working ..i tried it but while bar replay it shows same low for all furter candles from where i have started bar replay
Plus