Re: Already Converted TradingView Indicators to MT4 Indicators

201
nwesterhuijs wrote: Wed Dec 07, 2022 3:40 pm Thank you MrTools and Kvak for picking up on this. I had indeed corrected already some errors since then but was still aiming to debug more before posting an update.

Only saw your efforts this morning (after the daily download mention) and I yet need to drop it on a chart this evening, but MrTools can you check 1 thing:

You indicated you have incorporated the iVidya into the iCustomMa call, which sounds fine but you provide the following code:

Code: Select all

      double hi   = high[ArrayMinimum(high,HLPeriod,i)];
      double lo   =  low[ArrayMinimum( low,HLPeriod,i)];
         wrk[r].valH = iCustomMa(MaType,hi,MaLength,i,rates_total,0);
         wrk[r].valL = iCustomMa(MaType,lo,MaLength,i,rates_total,1);
Pls confirm but I reckon the High should be looking for the maximum and therefore look like this:

Code: Select all

      double hi   = high[ArrayMaximum(high,HLPeriod,i)];
      double lo   =  low[ArrayMinimum( low,HLPeriod,i)];
         wrk[r].valH = iCustomMa(MaType,hi,MaLength,i,rates_total,0);
         wrk[r].valL = iCustomMa(MaType,lo,MaLength,i,rates_total,1);
Also curious how the VidyaSmoothPeriod is handled now that the Vidya is incorporated in the iCustom call. Will see that tonight.

Furthermore, and again I need to see how it is handled this evening when I drop the indie on a chart, but I think it is lost in this latest version given that you are calling the arrays "high" and "low" which normally means you have replaced the "start"-function by the "OnCalculate"-function, which in turn would mean that the HOTTLOTT has lost the functionality (at least the one I added) of using the open and close as well as the high and low to create the channels. Is this deduction correct?

Nonetheless thank you both for pushing this one along quicker than I have managed thus far, much appreciated.

Cheers, Norbert
Hi Norbert,

In the vidya the smooth period is built in, in the function it was done this way to make it easier when included in the averages. Can be done the other way but when you have a bunch of different averages with more than period and price values, it can be a major pain if you want to include them as well.

Shouldn't matter whether you use "start" function or "OnCalculate" function you still have built in price arrays, only difference I have found is in "OnCalculate" function they are not capitalized, that's the only difference I have found. Posting a new version, where you can choose either hi/lo mode and if that is shut off you can choose whatever combination of the 30+ averages for the channel, the other prices are there for whatever price you want for breakout of the channel mode, some prefer a different price method for the channel breakout.

Again, THANKS for your version. Snapshot is using hl/lo mode off and using Heiken Ashi better formula open/close.
These users thanked the author mrtools for the post (total 11):
josi, oskar656, Jedidiah, Chickenspicy, kvak, thomdel, alexm, Jackson Doh, 太虚一毫, RodrigoRT7, SijjiN


Re: Already Converted TradingView Indicators to MT4 Indicators

203
respected sir kvak please convert these indicator in mt4
https://www.tradingview.com/script/Et6Y ... Index-LUX/

Code: Select all

// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo

//@version=5
indicator("Squeeze Index [LuxAlgo]", "Squeeze Index [LuxAlgo]")
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
conv   = input(50, 'Convergence Factor')

length = input(20)

src = input(close)

//Style
col_0 = input(#ffeb3b, 'Gradient'
  , inline = 'inline0'
  , group = 'Style')
  
col_1 = input(#ff5d00, ''
  , inline = 'inline0'
  , group = 'Style')
  
col_2 = input(#ff1100, ''
  , inline = 'inline0'
  , group = 'Style')

//-----------------------------------------------------------------------------}
//Squeeze index
//-----------------------------------------------------------------------------{
var max = 0.
var min = 0.

max := nz(math.max(src, max - (max - src) / conv), src)
min := nz(math.min(src, min + (src - min) / conv), src)
diff = math.log(max - min)

psi = -50 * ta.correlation(diff, bar_index, length) + 50

//-----------------------------------------------------------------------------}
//Plots
//-----------------------------------------------------------------------------{
css1 = color.from_gradient(psi, 0, 80, col_0, col_1)
css2 = color.from_gradient(psi, 80, 100, css1, col_2)

plot_0 = plot(psi, 'PSI', psi > 80 ? na : css2)
plot(psi, 'Dots', psi > 80 ? css2 : na, style = plot.style_cross)

plot_1 = plot(80, display = display.none, editable = false)

fill(plot_0, plot_1, psi < 80 ? na : color.new(#ff1100, 80))

hline(80)

//-----------------------------------------------------------------------------}
Attachments
These users thanked the author muhammadfarooq for the post:
Jedidiah
exness is scam broker. avoid Exness

Re: Already Converted TradingView Indicators to MT4 Indicators

204
if you have a profitable strategy from it then i'll do it

muhammadfarooq wrote: Sun Dec 18, 2022 1:52 am respected sir kvak please convert these indicator in mt4
https://www.tradingview.com/script/Et6Y ... Index-LUX/

Code: Select all

// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo

//@version=5
indicator("Squeeze Index [LuxAlgo]", "Squeeze Index [LuxAlgo]")
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
conv   = input(50, 'Convergence Factor')

length = input(20)

src = input(close)

//Style
col_0 = input(#ffeb3b, 'Gradient'
  , inline = 'inline0'
  , group = 'Style')
  
col_1 = input(#ff5d00, ''
  , inline = 'inline0'
  , group = 'Style')
  
col_2 = input(#ff1100, ''
  , inline = 'inline0'
  , group = 'Style')

//-----------------------------------------------------------------------------}
//Squeeze index
//-----------------------------------------------------------------------------{
var max = 0.
var min = 0.

max := nz(math.max(src, max - (max - src) / conv), src)
min := nz(math.min(src, min + (src - min) / conv), src)
diff = math.log(max - min)

psi = -50 * ta.correlation(diff, bar_index, length) + 50

//-----------------------------------------------------------------------------}
//Plots
//-----------------------------------------------------------------------------{
css1 = color.from_gradient(psi, 0, 80, col_0, col_1)
css2 = color.from_gradient(psi, 80, 100, css1, col_2)

plot_0 = plot(psi, 'PSI', psi > 80 ? na : css2)
plot(psi, 'Dots', psi > 80 ? css2 : na, style = plot.style_cross)

plot_1 = plot(80, display = display.none, editable = false)

fill(plot_0, plot_1, psi < 80 ? na : color.new(#ff1100, 80))

hline(80)

//-----------------------------------------------------------------------------}
Image
These users thanked the author ionone for the post:
Sepo


Re: Already Converted TradingView Indicators to MT4 Indicators

206
I put it in other thread. If anyone has this indicator converted will be great. It is called Boom Hunter pro. They say that maybe it is the greatest indicator ever.
https://www.tradingview.com/script/coMN ... unter-Pro/

There are a lot of videos, and all of them, they tell that it is impressive.




Happy christmas to everyone!!!
Attachments
These users thanked the author hache for the post (total 3):
Chickenspicy, Jedidiah, Banzai

Re: Already Converted TradingView Indicators to MT4 Indicators

207
hi mr.tools/Jimmy & Kvak
Wish you a merry Christmas

i find a good indi and code below .. this box indicator and forcast prediction will helps the trend . possible to convert this or similiar have in mt4!!, please share

/

Code: Select all

/@version=4
study("The Echo Forecast [LUX]","ECHO [LuxAlgo]",overlay=true,max_bars_back=1000,max_lines_count=200)
length = input(50,'Evaluation Window',minval=0,maxval=200)
fcast  = input(50,'Forecast Window',minval=1,maxval=200)

fmode  = input('Similarity','Forecast Mode',options=['Similarity','Dissimilarity'])
cmode  = input('Cumulative','Forecast Construction',options=['Cumulative','Mean','Linreg'])
src    = input(close)

fcast_col   = input(#2157f3,'Forecast Style',inline='fcast_style',group='Style')
fcast_style = input('· · ·','',options=['──','- - -','· · ·'],inline='fcast_style',group='Style')

show_area   = input(true,'Show Area',inline='areas',group='Style')
fcast_area  = input(color.new(#ff5d00,50),'',inline='areas',group='Style')
corr_area   = input(color.new(#0cb51a,50),'',inline='areas',group='Style')
eval_area   = input(color.new(color.gray,50),'',inline='areas',group='Style')
//----
var lines = array.new_line(0)
if barstate.isfirst
    for i = 0 to fcast-1
        array.push(lines,line.new(na,na,na,na))
//----
n = bar_index
d = change(src)

top = highest(src,length+fcast*2)
btm = lowest(src,length+fcast*2)

if barstate.islast
    float val = na
    k = 0
    A = array.new_float(0)
    X = array.new_int(0)
    for i = 0 to fcast*2+length
        array.push(A,src[i])
        if cmode == 'Linreg'
            array.push(X,n[i])
    
    a = array.slice(A,0,fcast-1)
    for i = 0 to length-1
        b = array.slice(A,fcast+i,fcast*2+i-1)
        r = array.covariance(a,b)/(array.stdev(a)*array.stdev(b))
        if fmode == 'Similarity'
            val := r >= nz(val,r) ? r : val
        else
            val := r <= nz(val,r) ? r : val
        k := val == r ? i : k
    
    prev = src
    current = src
    
    for i = 0 to fcast-1
        e = d[fcast+k+(fcast-i-1)]
        if cmode == 'Mean'
            current := array.avg(a) + e
        else if cmode == 'Linreg'
            a = array.slice(A,0,fcast)
            x = array.slice(X,0,fcast)
            alpha = array.covariance(a,x)/array.variance(x)
            beta = array.avg(a) - alpha*array.avg(x)
            current := alpha*(n+i+1) + beta + e
        else
            current += e
        
        l = array.get(lines,i)
        line.set_xy1(l,n+i,prev)
        line.set_xy2(l,n+i+1,current)
        line.set_color(l,fcast_col)
        
        if fcast_style == '- - -'
            line.set_style(l,line.style_dashed)
        else if fcast_style == '· · ·'
            line.set_style(l,line.style_dotted)
        
        prev := current

    if show_area    
        box.delete(box.new(n-length-fcast*2+1,top,n-fcast+1,btm,
          border_color=na,
          bgcolor=eval_area)[1])
        box.delete(box.new(n-fcast+1,top,n,btm,
          border_color=na,
          bgcolor=fcast_area)[1])
        box.delete(box.new(n-k-fcast*2+1,btm,n-k-fcast,top,
          border_color=na,
          bgcolor=corr_area)[1]) 
Attachments
These users thanked the author sal for the post (total 2):
hache, Jedidiah
"There is NO GOD higher than TRUTH" - Mahatma Gandhi

Re: Already Converted TradingView Indicators to MT4 Indicators

208
sal wrote: Sun Dec 25, 2022 3:55 pm hi mr.tools/Jimmy & Kvak
Wish you a merry Christmas

i find a good indi and code below .. this box indicator and forcast prediction will helps the trend . possible to convert this or similiar have in mt4!!, please share

/

Code: Select all

/@version=4
study("The Echo Forecast [LUX]","ECHO [LuxAlgo]",overlay=true,max_bars_back=1000,max_lines_count=200)
length = input(50,'Evaluation Window',minval=0,maxval=200)
fcast  = input(50,'Forecast Window',minval=1,maxval=200)

fmode  = input('Similarity','Forecast Mode',options=['Similarity','Dissimilarity'])
cmode  = input('Cumulative','Forecast Construction',options=['Cumulative','Mean','Linreg'])
src    = input(close)

fcast_col   = input(#2157f3,'Forecast Style',inline='fcast_style',group='Style')
fcast_style = input('· · ·','',options=['──','- - -','· · ·'],inline='fcast_style',group='Style')

show_area   = input(true,'Show Area',inline='areas',group='Style')
fcast_area  = input(color.new(#ff5d00,50),'',inline='areas',group='Style')
corr_area   = input(color.new(#0cb51a,50),'',inline='areas',group='Style')
eval_area   = input(color.new(color.gray,50),'',inline='areas',group='Style')
//----
var lines = array.new_line(0)
if barstate.isfirst
    for i = 0 to fcast-1
        array.push(lines,line.new(na,na,na,na))
//----
n = bar_index
d = change(src)

top = highest(src,length+fcast*2)
btm = lowest(src,length+fcast*2)

if barstate.islast
    float val = na
    k = 0
    A = array.new_float(0)
    X = array.new_int(0)
    for i = 0 to fcast*2+length
        array.push(A,src[i])
        if cmode == 'Linreg'
            array.push(X,n[i])
    
    a = array.slice(A,0,fcast-1)
    for i = 0 to length-1
        b = array.slice(A,fcast+i,fcast*2+i-1)
        r = array.covariance(a,b)/(array.stdev(a)*array.stdev(b))
        if fmode == 'Similarity'
            val := r >= nz(val,r) ? r : val
        else
            val := r <= nz(val,r) ? r : val
        k := val == r ? i : k
    
    prev = src
    current = src
    
    for i = 0 to fcast-1
        e = d[fcast+k+(fcast-i-1)]
        if cmode == 'Mean'
            current := array.avg(a) + e
        else if cmode == 'Linreg'
            a = array.slice(A,0,fcast)
            x = array.slice(X,0,fcast)
            alpha = array.covariance(a,x)/array.variance(x)
            beta = array.avg(a) - alpha*array.avg(x)
            current := alpha*(n+i+1) + beta + e
        else
            current += e
        
        l = array.get(lines,i)
        line.set_xy1(l,n+i,prev)
        line.set_xy2(l,n+i+1,current)
        line.set_color(l,fcast_col)
        
        if fcast_style == '- - -'
            line.set_style(l,line.style_dashed)
        else if fcast_style == '· · ·'
            line.set_style(l,line.style_dotted)
        
        prev := current

    if show_area    
        box.delete(box.new(n-length-fcast*2+1,top,n-fcast+1,btm,
          border_color=na,
          bgcolor=eval_area)[1])
        box.delete(box.new(n-fcast+1,top,n,btm,
          border_color=na,
          bgcolor=fcast_area)[1])
        box.delete(box.new(n-k-fcast*2+1,btm,n-k-fcast,top,
          border_color=na,
          bgcolor=corr_area)[1]) 
Image
This seems a very interesting indicator too. Here you have a video of how to use it:
These users thanked the author hache for the post (total 3):
sal, RodrigoRT7, Jedidiah

Re: Already Converted TradingView Indicators to MT4 Indicators

210


This indicator uses a simple time series forecasting method derived from the similarity between recent prices and similar/dissimilar historical prices. We named this method "ECHO".

This method originally assumes that future prices can be estimated from a historical series of observations that are most similar to the most recent price variations. This similarity is quantified using the correlation coefficient . Such an assumption can prove to be relatively effective with the forecasting of a periodic time series. We later introduced the ability to select dissimilar series of observations for further experimentation.

This forecasting technique is closely inspired by the analogue method introduced by Lorenz for the prediction of atmospheric data.

1. Settings

Evaluation Window: Window size used for finding historical observations similar/dissimilar to recent observations. The total evaluation window is equal to "Forecast Window" + "Evaluation Window"
Forecast Window: Determines the forecasting horizon.
Forecast Mode: Determines whether to choose historical series similar or dissimilar to the recent price observations.
Forecast Construction: Determines how the forecast is constructed. See "Usage" below.
Src: Source input of the forecast

Other style settings are self-explanatory.

2. Usage

This tool can be used to forecast future trends but also to indicate which historical variations have the highest degree of similarity/dissimilarity between the observations in the orange zone.

The forecasting window determines the prices segment (in orange) to be used as a reference for the search of the most similar/dissimilar historical price segment (in green) within the gray area.
Most forecasting techniques highly benefit from a detrended series. Due to the nature of this method, we highly recommend applying it to a detrended and periodic series.
You can see above the method is applied on a smooth periodic oscillator and a momentum oscillator. The construction of the forecast is made from the price changes obtained in the green area, denoted as w(t). Using the "Cumulative" options we construct the forecast from the cumulative sum of w(t). Finally, we add the most recent price value to this cumulated series.
Using the "Mean" options will add the series w(t) with the mean of the prices within the orange segment.


Finally the "Linreg" will add the series w(t) to an extrapolated linear regression fit to the prices within the orange segment.
Attachments
Be patient therefore, brethren, until the coming of the Lord. Behold, the husbandman waiteth for the precious fruit of the earth: patiently bearing till he receive the early and latter rain.
Behold, we account them blessed who have endured. You have heard of the patience of Job, and you have seen the end of the Lord, that the Lord is merciful and compassionate.


Who is online

Users browsing this forum: Akela, Amazon [Bot], Bing [Bot], Proximic [Bot], rudiarius, sdsdzk, witori and 118 guests