Hello ThinkScripters, I need a favor if you can create a thinksript code for one of Tradingviews indicator (Koalafied Volume Extension).
https://www.tradingview.com/script/MGa2XVAf-Koalafied-Volume-Extension/
I have been watching and testing it for a while and seems very helpful with the super Trend indicator specially for intraday trading, I really appreciate your time and Thank you in advance . this is the code from Trading View
// This source code is subject to the terms of the Mozilla Public License 2.0 at
https://mozilla.org/MPL/2.0/
// © TJ_667
//@version=5
indicator("Koalafied Volume Extension", overlay = true)
// ---------- FUNCTIONS ---------- //
Z_score(_src, _length, MA_sel)=>
_mean = MA_sel == 'SMA' ? ta.sma(_src, _length) : MA_sel == 'EMA' ? ta.ema(_src, _length) : MA_sel == 'WMA' ? ta.wma(_src, _length) : na
_value = (_src - _mean) / (ta.stdev(_src-_mean, _length))
// ---------- INPUTS ---------- //
var GRP1 = "INPUTS"
len = input(21, "Z-Score MA Length", group = GRP1)
MA_sel = input.string(title='MA Selection', defval='SMA', options=['SMA', 'EMA', 'WMA'], group = GRP1)
deviation_1 = input(2.0, "Std Dev", group = GRP1)
deviation_2 = input(3.0, "Std Dev", group = GRP1)
rising_sel = input(false, "Colour rising volume bars", group = GRP1)
var GRP2 = "COLOR SELECTION"
_colup_ext2 = input.color(color.lime, "Bull Extension 2", group = GRP2)
_colup_ext1 = input.color(color.blue, "Bull Extension 1", group = GRP2)
_coldown_ext1 = input.color(color.red, "Bear Extension 1", group = GRP2)
_coldown_ext2 = input.color(color.purple, "Bear Extension 2", group = GRP2)
col_risingUP = input.color(color.white, "Rising Candle Color Up", group = GRP2)
col_risingDOWN = input.color(color.gray, "Rising Candle Color Down", group = GRP2)
col_blank = input.color(color.new(color.black,100), "Blank Candle Color", group = GRP2)
// ---------- CALCS ---------- //
src = volume
vol = Z_score(src, len, MA_sel)
extension_1 = vol > deviation_1 and vol < deviation_2
extension_2 = vol > deviation_2
bull = close > open
bear = close < open
rising = volume > volume[1]
rising_col = close > open and rising ? col_risingUP : close < open and rising ? col_risingDOWN : col_blank
_devUp2 = extension_2 and bull
_devUp1 = extension_1 and bull
_devDown1 = extension_1 and bear
_devDown2 = extension_2 and bear
// ---------- PLOTS ---------- //
barcolor(_devUp1 ? _colup_ext1 : _devDown1 ? _coldown_ext1 : na, title = "Extension 1")
barcolor(_devUp2 ? _colup_ext2 : _devDown2 ? _coldown_ext2 : na, title = "Extension 2")
barcolor(not extension_1 and not extension_2 and not rising_sel ? col_blank : not extension_1 and not extension_2 and rising_sel ? rising_col : na, title = "Rising/Falling")
// ---------- Alerts ---------- //
ext_alert = _devUp2 or _devUp1 or _devDown1 or _devDown2
alertcondition(ext_alert, "Volume Extension Alert", "VOL EXT")
NOTE : The colors White and Yellow are marking the high volume.
View attachment 19075