DislikeRe: Already Converted TradingView Indicators to MT4 Indicators

113
Knight wrote: Fri Sep 02, 2022 7:28 pm JCFBaux Volatility [Loxx] (close, 15, 0, 300)
Can this indicator be converted to mt4?
It's one of the best for filtering low volatility and choppy markets.
No because you haven't bothered to:

  • Attach an image or chart with examples
  • Show us anything except the name and settings
  • Insert the code

Good luck getting coders to be interested when you're posting like this :lolno:
Important: The worst forex brokers of all time 👎


DownloadRe: Already Converted TradingView Indicators to MT4 Indicators

119
<!-- TradingView Chart BEGIN -->
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<script type="text/javascript">
var tradingview_embed_options = {};
tradingview_embed_options.width = '640';
tradingview_embed_options.height = '400';
tradingview_embed_options.chart = 'fSTqdHYh';
new TradingView.chart(tradingview_embed_options);
</script>
<p><a href="https://www.tradingview.com/script/fSTq ... /">JCFBaux Volatility [Loxx]</a> by <a href="https://www.tradingview.com/u/loxx/">loxx</a> on <a href="https://www.tradingview.com/">TradingView.com</a></p>
<!-- TradingView Chart END -->

Re: Already Converted TradingView Indicators to MT4 Indicators

120
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © loxx

//@version=5
indicator("JCFBaux Volatility [Loxx]", shorttitle = "JCFBV [Loxx]", timeframe="", timeframe_gaps=true, overlay = false)
greencolor = #2DD204

_a_jurik_filt(src, len, phase) =>
len1 = math.max(math.log(math.sqrt(0.5 * (len-1))) / math.log(2.0) + 2.0, 0)
pow1 = math.max(len1 - 2.0, 0.5)
volty = 7.0, avolty = 9.0, vsum = 8.0, bsmax = 5.0, bsmin = 6.0, avgLen = 65

del1 = src - nz(bsmax[1])
del2 = src - nz(bsmin[1])

div = 1.0 / (10.0 + 10.0 * (math.min(math.max(len-10, 0), 100)) / 100)
volty := math.abs(del1) > math.abs(del2) ? math.abs(del1) : math.abs(del2)
vsum := nz(vsum[1]) + div * (volty - nz(volty[10]))

temp_avg = ta.sma(vsum, avgLen)

y = bar_index + 1
if(y <= avgLen + 1)
avolty := nz(avolty[1]) + 2.0 * (vsum - nz(avolty[1])) / (avgLen + 1)
else
avolty := temp_avg

dVolty = avolty > 0 ? volty / avolty : 0
dVolty := dVolty > math.pow(len1, 1.0/pow1) ? math.pow(len1, 1.0/pow1) : dVolty
dVolty := dVolty < 1 ? 1 : dVolty
pow2 = math.pow(dVolty, pow1)
len2 = math.sqrt(0.5 * (len - 1)) * len1
Kv = math.pow(len2 / (len2 + 1), math.sqrt(pow2))
bsmax := del1 > 0 ? src : src - Kv * del1
bsmin := del2 < 0 ? src : src - Kv * del2
phaseRatio = phase < -100 ? 0.5 : phase > 100 ? 2.5 : phase / 100 + 1.5
beta = 0.45 * (len - 1) / (0.45 * (len - 1) + 2)
alpha = math.pow(beta, pow2)
jma1 = 0.0, e0 = 0.0, e1 = 0.0, e2 = 0.0
e0 := (1 - alpha) * src + alpha * nz(e0[1])
e1 := (src - e0) * (1 - beta) + beta * nz(e1[1])
e2 := (e0 + phaseRatio * e1 - nz(jma1[1])) * math.pow(1 - alpha, 2) + math.pow(alpha, 2) * nz(e2[1])
jma1 := e2 + nz(jma1[1])
jma1


src = input.source(close, "Source")
depth = input.int(15, "Depth")
depthphase = input.float(0, "Jurik Smoothing Phase")
lensmdd = input.int(300, "Smoothing Period")

_jcfbau(src, depth)=>
jrc04 = 0.0, jrc05 = 0.0, jrc06 = 0.0, jrc13 = 0.0, jrc03 = 0.0, jrc08 = 0.0
if (bar_index >= bar_index - depth * 2)
for k = depth - 1 to 0
jrc04 := jrc04 + math.abs(nz(src[k]) - nz(src[k+1]))
jrc05 := jrc05 + (depth + k) * math.abs(nz(src[k]) - nz(src[k+1]))
jrc06 := jrc06 + nz(src[k+1])
if(bar_index < bar_index - depth * 2)
jrc03 := math.abs(src - nz(src[1]))
jrc13 := math.abs(nz(src[depth]) - nz(src[depth+1]))
jrc04 := jrc04 - jrc13 + jrc03
jrc05 := jrc05 - jrc04 + jrc03 * depth
jrc06 := jrc06 - nz(src[depth+1]) + nz(src[1])
jrc08 := math.abs(depth * src - jrc06)
jcfbaux = jrc05 == 0.0 ? 0.0 : jrc08/jrc05
jcfbaux

jcfbaux = _jcfbau(src, depth)
signal = _a_jurik_filt(jcfbaux, lensmdd, depthphase)

plot(signal, color = color.white)
plot(jcfbaux, color = jcfbaux >= signal ? greencolor : color.gray, linewidth = 2)
barcolor(jcfbaux >= signal ? greencolor : color.gray)



















Who is online

Users browsing this forum: DotNetDotCom [Bot], Facebook [Crawler], Grapeshot [Bot], IBM oBot [Bot], Proximic [Bot], Ruby [Bot], Sogou [Bot], vvFish and 105 guests