Heikin-Ashi Strategy V1 by breizh29


Here is my strategy based on Heikin-Ashi Open/Close price.
Feedbacks are welcome.
Let me know if it repaints, im not sure of this.
Remove from Favorite Scripts Add to Favorite Scripts
strategy("Heikin-Ashi Strategy V1 by breizh29",shorttitle="HAS V1",overlay=true,default_qty_value=1000,initial_capital=100000,currency=currency.EUR)
res = input(title="Resolution", type=resolution, defval="180")
hshift = input(0,title="Heikin Ashi Shift")
fama = input(2,"Heikin Ashi Close Period")
sloma = input(30,"EMA Period")
slomas = input(1,"EMA Shift")

//Heikin Ashi Open/Close Price
ha_t = heikinashi(tickerid)
ha_open = security(ha_t, res, open)
ha_close = security(ha_t, res, close[hshift])

//Moving Average
fma = sma(ha_close,fama)
sma = ema(close[slomas],sloma)

golong = crossover(ha_close,ha_open) and crossover(fma,sma)
goshort = crossunder(ha_close,ha_open) and crossunder(fma,sma)

strategy.entry("Buy",strategy.long,when = golong)
strategy.entry("Sell",strategy.short,when = goshort)

vaicru PRO
11 months ago
Works in any timeframe ?
works only wiht usdjpy ? Stocks?
breizh29 vaicru
11 months ago
Heiken ashi time frame must be greater then the chart timeframe. 180mn for Heiken Ashi and 15 mn for chart (standard candles) works fine.
It works fine for forex and average for stocks.
The signals are repainting sometimes, that's beceause the Heiken Ashi Close price is calculated on the fly.
11 months ago
Unfortunately, I confirm that it repaints. Just repainted on SPX500 15min charts. Is this because you are using Heikin Ashi bars instead of simple candlesticks?
breizh29 skiislife
11 months ago
yes its Heikin Ashi Close price which is calculatet by OHLC/4 of current bar. TradingView recalculate this price at close of the 180mn Heikin Ashi bar. Thats why its repainting.
harryli PRO breizh29
3 months ago
res = input(title="Resolution", type=resolution, defval="180")
it's not TV recalculate ,its you intentionally use this to repaint
scgroup PRO
8 months ago
It repaints. Anytime you use a higher resolution timeframe, you don't actually know the outcome until the close of that higher timeframe. Maybe it looks one way when you are watching it live but after all is said and done, it could completely change and the strategy tester is only looking back in time after the closes which you cannot know in real time.
Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out