Strategy vault / Trend following
Rolling Heikin Ashi Candles
█ OVERVIEW This indicator displays a Rolling Heikin Ashi Candles for a given timeframe Multiplier. Contrary to Heikin Ashi Candles Charts, if the timeframe Multiplier is "5", this indicator plots Heikin Ashi Candles…
█ OVERVIEW
This indicator displays a Rolling Heikin Ashi Candles for a given timeframe Multiplier. Contrary to Heikin Ashi Candles Charts, if the timeframe Multiplier is "5", this indicator plots Heikin Ashi Candles OHLC of the last 5 Candles.
█ WHAT IS THE NEED FOR IT
Let's see if we want to use a Higher timeframe OHLC Data using security function or resolution options. The indicator repaints until the higher timeframe Heikin Ashi Candles closes, leading to a repainting strategy or indicator using higher-timeframe data. So we can use Rolling Heikin Ashi Candles in these cases.
█ USES
To Pull out higher timeframe Heikin Ashi Candles OHLC Data to build a non-repainting strategy or indicator.
█ WHY I AM BUILDING THIS SIMPLE INDICATOR
There is no doubt higher timeframe analysis is a critical study to mastering the markets. I found a necessity for an indicator that analyses multiple higher timeframes and gives us a cumulative or average trend direction. I already built the indicator; I will release it soon. The Indicator I am building is wholly based on my understanding and perspective of Market Structure. Please use this indicator idea to remove the repainting issue when you make an indicator that utilises higher timeframe data.
I am using this in my upcoming indicators. Felt to share before head.
Stay Tuned...
If you have any recommendations or alternative ideas, then please drop a comment under the script ;)
backtest

Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 5 | Timeframe Multiplier |
Source Pine Script
/*backtest
start: 2022-01-01 00:00:00
end: 2022-03-11 00:00:00
period: 6h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
study(title='Rolling Heikin Ashi Candles', shorttitle='Rolling Heikin Ashi')
tf = input(5, 'Timeframe Multiplier', minval=1, step=1, type = input.integer)
haclose = (open[tf-1]+highest(high,tf)+lowest(low,tf)+close)/4
haopen = (open[tf-1] + close)/2
if(not na(haopen[2*tf-1]))
haopen := (haopen[2*tf-1] + haclose[tf]) / 2
hahigh = max(highest(high,tf), max(haopen,haclose))
halow = min(lowest(low,tf), min(haopen,haclose))
Color = haopen > haclose ? #ef5350 : #26a69a
//plotcandle(haopen, hahigh, halow, haclose, title='Rolling Heikin Ashi', color=Color, wickcolor=Color, bordercolor=Color)
if haopen > haclose
strategy.entry("Enter Long", strategy.long)
else if haopen < haclose
strategy.entry("Enter Short", strategy.short)Published by ChaoZhang on the FMZ strategy square · last modified 2022-05-12. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Rolling-Heikin-Ashi-Candles.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- ATR Dynamic Trend Following and EMA Crossover Trading StrategyPine Script · Trend following · 1d
- Dual EMA Filtered ATR Adaptive Trend Following StrategyPine Script · Trend following · 1h
- Dual Hull Moving Average Trading StrategyPine Script · Trend following · 1d
- Full Crypto Swing ALMA Cross MACD Quantitative StrategyPine Script · Trend following · 1h
- Heiken Ashi and Super Trend Combination StrategyPine Script · Trend following · 1d
- Incremental Order Size Fibonacci Retracement Trend Following StrategyPine Script · Trend following · 1d