RicardoSantos

[RS]Adaptive Range Candles V0

920 visningar
72
EXPERIMENTAL:
similar to renko.
Ta bort från favoritskript Lägg till som favoritskript
//@version=2
study(title='[RS]Adaptive Range Candles V0', shorttitle='ARC', overlay=true)
multiplier = input(title='Range Multiplier:', type=float, defval=0.01)
SHOW_CLOSE_LINE = input(title='Show Close Line?', type=bool, defval=true)

h = na(h[1]) ? high : high >= h[1] ? high : h[1]
l = na(l[1]) ? low : low <= l[1] ? low : l[1]
range = (h-l)*multiplier

avg = na(avg[1]) ? close : close > avg[1] + range ? close : close < avg[1] - range ? close : avg[1]
pavg = change(avg) != 0 ? valuewhen(change(avg) != 0, avg, 1) : pavg[1]

plotcandle(pavg, high, low, avg, color=avg > pavg ? lime : red)
plot(title='C', series=SHOW_CLOSE_LINE?close:na, color=black, linewidth=1, transp=0)

Kommentarer

@RicardoSantos thanks for the indicator.

I ran a video recording of 20 hours on 5 min timeframe, got a repaint result.

From reading the code it should not repaint. Can you explain why it is repainting?

I have an idea, but i want to know what you think, so I wont give you bias.
thanks
Svara
@ZoharCho, if it is repainting its not the pinescript code
Svara
ZoharCho RicardoSantos
@RicardoSantos, i think its a tradingview issue
Svara
Thanks Ricardo for sharing!!! Can multiple Candles in same Range be condensed into one Range Candle or Bar for filtering instead of multiple Range Candles so that Range Bar is only having variable Price not Time?
Svara
RicardoSantos sudhir.mehta
not possible in pinescript, as this is a overlay on top of already existing candles, for that it would need to be built in and replace the underlying candles.
Svara
Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Hur det fungerar Diagramfunktioner Priser Tipsa en vän Ordningsregler Hjälpcenter Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter
Profil Profilinställningar Konto och fakturering Referred friends Coins Mina kölappar Hjälpcenter Publicerade idéer Följare Följer Privata meddelanden Chatt Logga ut