Re: MT4 Trading Systems (Old or new!) Please post here

551
Enes Kocoglu wrote: Sat Apr 01, 2023 11:02 pm Can you share the template? Maybe then I can understand better.

Oh please, no offense. I'm sure you can put a mere 3 Indicators on the chart. All from FXStation here.

Ma Ribbon 2x i.e. longer Period first 3x the shorter period, method 2, price weighed
Renko double channel, default
color_zerolag rvi
These users thanked the author RplusT for the post:
Enes Kocoglu


Re: MT4 Trading Systems (Old or new!) Please post here

553
RplusT wrote: Wed Nov 25, 2020 11:34 pm You know trading is boring. Besides placing some orders to put food on the table I spend thousands of hours to put together sophisticated charts and program never
seen before Indicators only to give it away for free. This time I really intended to sell that. But then, in the light of the fact that Trump is generously pardoning one of his turkeys named Flynn, I thought I needed to show some generosity for Thanksgiving too.

So, here it is: My new Indicator MA_high low, HA Kuskus 3, Tarzan, VWAP and Gann HiLo. Don't worry, it's not as complicated: as it looks: When you see red, SELL, when it's Blue BUY! (For the TARZAN AutoMTF key in -1 for the next higher TF or -2 for the second higher TF in the Parameter window).
Unfortunately I ran out of big Arrows for up and down. Forgot to buy some more........ :D :D :D

Again, to put it in a nutshell: It does not matter what you put on the chart as long as you follow direction. Actually, even the VWAP alone would have suggested nice trades.



Image


Image







Heiken_Ashi_kuskus3.mq4
MA in Color_wAppliedPrice.mq4
TARZAN FIX +.mq4
XU-SEMAFOR v3.mq4
XU-VWAP button.mq4
Gann HiLo activator bars.ex4
MA_High Low_Test.tpl
0 + 0 = 0
Infinite / Infinite = 1
1 way to Heaven & it matters


Re: MT4 Trading Systems (Old or new!) Please post here

556
for the peeps on TradingView

Code: Select all

// 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("End-pointed SSA of Normalized Price Oscillator [Loxx]",
     shorttitle = "EPSSANPO [Loxx]", 
     overlay = false, 
     timeframe="", 
     timeframe_gaps = true)
     
import loxx/loxxexpandedsourcetypes/4

greencolor = #2DD204
redcolor = #D2042D 

int Maxncomp = 25
int MaxLag = 200
int MaxArrayLength = 1000

// Calculation of the function Sn, needed to calculate the eigenvalues
// Negative determinants are counted there 
gaussSn(matrix<float> A, float l, int n)=>
    array<float> w = array.new<float>(n, 0)
    matrix<float> B = matrix.copy(A)
    int count = 0
    int cp = 0
    float c = 0.
    float s1 = 0.
    float s2 = 0.
    for i = 0 to n - 1 
        matrix.set(B, i, i, matrix.get(B, i, i) - l)
    for k = 0 to n - 2 
        for i = k + 1 to n - 1 
            if matrix.get(B, k, k) == 0
                for i1 = 0 to n - 1
                    array.set(w, i1, matrix.get(B, i1, k)) 
                    matrix.set(B, i1, k, matrix.get(B, i1, k + 1))
                    matrix.set(B, i1, k + 1, array.get(w, i1))
                cp := cp + 1
            c := matrix.get(B, i, k) / matrix.get(B, k, k) 
            for j = 0 to n - 1 
                matrix.set(B, i, j, matrix.get(B, i, j) - matrix.get(B, k, j) * c)
    count := 0
    s1 := 1
    for i = 0 to n - 1 
        s2 := matrix.get(B, i, i) 
        if s2 < 0
            count := count + 1
    count

// Calculation of eigenvalues by the bisection method}
// The good thing is that as many eigenvalues are needed, so many will count,
// saves a lot of resources
gaussbisectionl(matrix<float> A, int k, int n)=>
    float e1 = 0.
    float maxnorm = 0.
    float cn = 0.
    float a1 = 0.
    float b1 = 0.
    float c = 0.
    for i = 0 to n - 1 
        cn := 0
        for j = 0 to n - 1 
            cn := cn + matrix.get(A, i, i) 
        if maxnorm < cn 
            maxnorm := cn
    a1 := 0
    b1 := 10 * maxnorm
    e1 := 1.0 * maxnorm / 10000000
    while math.abs(b1 - a1) > e1
        c := 1.0 * (a1 + b1) / 2
        if gaussSn(A, c, n) < k
            a1 := c
        else
            b1 := c
    float out = (a1 + b1) / 2.0
    out

// Calculates eigenvectors for already computed eigenvalues 
svector(matrix<float> A, float l, int n, array<float> V)=>
    int cp = 0
    matrix<float> B = matrix.copy(A)
    float c = 0
    array<float> w = array.new<float>(n, 0)
    for i = 0 to n - 1 
        matrix.set(B, i, i, matrix.get(B, i, i) - l)
    for k = 0 to n - 2 
        for i = k + 1 to n - 1
            if matrix.get(B, k, k) == 0
                for i1 = 0 to n - 1 
                    array.set(w, i1, matrix.get(B, i1, k))
                    matrix.set(B, i1, k, matrix.get(B, i1, k + 1))
                    matrix.set(B, i1, k + 1, array.get(w, i1))
                cp += 1
            
            c := 1.0 * matrix.get(B, i, k) / matrix.get(B, k, k) 
            for j = 0 to n - 1 
                matrix.set(B, i, j, matrix.get(B, i, j) - matrix.get(B, k, j) * c)
    array.set(V, n - 1, 1)
    c := 1
    for i = n - 2 to 0 
        array.set(V, i, 0) 
        for j = i to n - 1 
            array.set(V, i, array.get(V, i) - matrix.get(B, i, j) * array.get(V, j))
        array.set(V, i, array.get(V, i) / matrix.get(B, i, i))
        c += math.pow(array.get(V, i), 2)
    for i = 0 to n - 1 
        array.set(V, i, array.get(V, i) / math.sqrt(c))

// Fast Singular SSA - "Caterpillar" method
// X-vector of the original series
// n-length
// l-lag length
// s-number of eigencomponents
// (there the original series is divided into components, and then restored, here you set how many components you need)
// Y - the restored row (smoothed by the caterpillar) 
fastsingular(array<float> X, int n1, int l1, int s1)=>
    int n = math.min(MaxArrayLength, n1)
    int l = math.min(MaxLag, l1)
    int s = math.min(Maxncomp, s1)
    
    matrix<float> A = matrix.new<float>(l, l, 0.)
    matrix<float> B = matrix.new<float>(n, l, 0.)
    matrix<float> Bn = matrix.new<float>(l, n, 0.)
    matrix<float> V = matrix.new<float>(l, n, 0.)
    matrix<float> Yn = matrix.new<float>(l, n, 0.)
    
    var array<float> vtarr = array.new<float>(l, 0.)
    array<float> ls = array.new<float>(MaxLag, 0)
    array<float> Vtemp = array.new<float>(MaxLag, 0)
    array<float> Y = array.new<float>(n, 0)
    
    int k = n - l + 1
    
    // We form matrix A in the method that I downloaded from the site of the creators of this matrix S 
    for i = 0 to l - 1  
        for j = 0 to l - 1 
            matrix.set(A, i, j, 0)
            for m = 0 to k - 1 
                matrix.set(A, i, j, matrix.get(A, i, j) + array.get(X, i + m) * array.get(X, m + j))
                matrix.set(B, m, j, array.get(X, m + j))

    //Find the eigenvalues and vectors of the matrix A
    for i = 0 to s - 1  
        array.set(ls, i, gaussbisectionl(A, l - i, l))
        svector(A, array.get(ls, i), l, Vtemp)  
        for j = 0 to l - 1 
			matrix.set(V, i, j, array.get(Vtemp, j))

    // The restored matrix is formed
    for i1 = 0 to s - 1
        for i = 0 to k - 1  
            matrix.set(Yn, i1, i, 0) 
            for j = 0 to l - 1  
				matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(B, i, j) * matrix.get(V, i1, j))

        for i = 0 to l - 1 
            for j = 0 to k - 1 
				matrix.set(Bn, i, j, matrix.get(V, i1, i) * matrix.get(Yn, i1, j))
				
        //Diagonal averaging (series recovery)
        kb = k
        lb = l
        for i = 0 to n - 1  
            matrix.set(Yn, i1, i, 0)
            if i < lb - 1 
                for j = 0 to i
                    if l <= k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, j, i - j))
                    if l > k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, i - j, j))
                
                matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) / (1.0 * (i + 1)))
            if (lb - 1 <= i) and (i < kb - 1)
                for j = 0 to lb - 1  
                    if l <= k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, j, i - j))
                    if l > k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, i - j, j))
                matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) / (1.0 * lb))
            if kb - 1 <= i 
                for j = i - kb + 1 to n - kb  
                    if l <= k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, j, i - j))
                    if l > k
						matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) + matrix.get(Bn, i - j, j))
    
                matrix.set(Yn, i1, i, matrix.get(Yn, i1, i) / (1.0 * (n - i))) 

    // Here, if not summarized, then there will be separate decomposition components
    // process by own functions 
    for i = 0 to n - 1
        array.set(Y, i, 0) 
        for i1 = 0 to s - 1  
            array.set(Y, i, array.get(Y, i) + matrix.get(Yn, i1, i))
    Y

smthtype = input.string("Kaufman", "Heiken-Ashi Better Smoothing", options = ["AMA", "T3", "Kaufman"], group=  "Source Settings")
srcoption = input.string("Close", "Source", group= "Source Settings", 
     options = 
     ["Close", "Open", "High", "Low", "Median", "Typical", "Weighted", "Average", "Average Median Body", "Trend Biased", "Trend Biased (Extreme)", 
     "HA Close", "HA Open", "HA High", "HA Low", "HA Median", "HA Typical", "HA Weighted", "HA Average", "HA Average Median Body", "HA Trend Biased", "HA Trend Biased (Extreme)",
     "HAB Close", "HAB Open", "HAB High", "HAB Low", "HAB Median", "HAB Typical", "HAB Weighted", "HAB Average", "HAB Average Median Body", "HAB Trend Biased", "HAB Trend Biased (Extreme)"])

lag = input.int(10, "Lag")
ncomp = input.int(2, "Number of Computations", group = "Bands Settings")
ssapernorm = input.int(20, "SSA Period Normalization", group = "Bands Settings")
numbars = input.int(300, "Number of Bars", group = "Bands Settings")
backbars = input.int(400, "Number of Back", group = "Bands Settings")

colorbars = input.bool(true, "Color bars?", group = "UI Options")
showSigs = input.bool(true, "Show signals?", group = "UI Options")
showraw = input.bool(false, "Show pre-SSA?", group = "UI Options", tooltip = "This has no value other than to demonstrate the value of the calc before SSA morphing.")

kfl=input.float(0.666, title="* Kaufman's Adaptive MA (KAMA) Only - Fast End", group = "Moving Average Inputs")
ksl=input.float(0.0645, title="* Kaufman's Adaptive MA (KAMA) Only - Slow End", group = "Moving Average Inputs")
amafl = input.int(2, title="* Adaptive Moving Average (AMA) Only - Fast", group = "Moving Average Inputs")
amasl = input.int(30, title="* Adaptive Moving Average (AMA) Only - Slow", group = "Moving Average Inputs")

haclose = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)
haopen = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, open)
hahigh = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, high)
halow = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, low)
hamedian = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, hl2)
hatypical = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, hlc3)
haweighted = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, hlcc4)
haaverage = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, ohlc4)

float src = switch srcoption
	"Close" => loxxexpandedsourcetypes.rclose()
	"Open" => loxxexpandedsourcetypes.ropen()
	"High" => loxxexpandedsourcetypes.rhigh()
	"Low" => loxxexpandedsourcetypes.rlow()
	"Median" => loxxexpandedsourcetypes.rmedian()
	"Typical" => loxxexpandedsourcetypes.rtypical()
	"Weighted" => loxxexpandedsourcetypes.rweighted()
	"Average" => loxxexpandedsourcetypes.raverage()
    "Average Median Body" => loxxexpandedsourcetypes.ravemedbody()
	"Trend Biased" => loxxexpandedsourcetypes.rtrendb()
	"Trend Biased (Extreme)" => loxxexpandedsourcetypes.rtrendbext()
	"HA Close" => loxxexpandedsourcetypes.haclose(haclose)
	"HA Open" => loxxexpandedsourcetypes.haopen(haopen)
	"HA High" => loxxexpandedsourcetypes.hahigh(hahigh)
	"HA Low" => loxxexpandedsourcetypes.halow(halow)
	"HA Median" => loxxexpandedsourcetypes.hamedian(hamedian)
	"HA Typical" => loxxexpandedsourcetypes.hatypical(hatypical)
	"HA Weighted" => loxxexpandedsourcetypes.haweighted(haweighted)
	"HA Average" => loxxexpandedsourcetypes.haaverage(haaverage)
    "HA Average Median Body" => loxxexpandedsourcetypes.haavemedbody(haclose, haopen)
	"HA Trend Biased" => loxxexpandedsourcetypes.hatrendb(haclose, haopen, hahigh, halow)
	"HA Trend Biased (Extreme)" => loxxexpandedsourcetypes.hatrendbext(haclose, haopen, hahigh, halow)
	"HAB Close" => loxxexpandedsourcetypes.habclose(smthtype, amafl, amasl, kfl, ksl)
	"HAB Open" => loxxexpandedsourcetypes.habopen(smthtype, amafl, amasl, kfl, ksl)
	"HAB High" => loxxexpandedsourcetypes.habhigh(smthtype, amafl, amasl, kfl, ksl)
	"HAB Low" => loxxexpandedsourcetypes.hablow(smthtype, amafl, amasl, kfl, ksl)
	"HAB Median" => loxxexpandedsourcetypes.habmedian(smthtype, amafl, amasl, kfl, ksl)
	"HAB Typical" => loxxexpandedsourcetypes.habtypical(smthtype, amafl, amasl, kfl, ksl)
	"HAB Weighted" => loxxexpandedsourcetypes.habweighted(smthtype, amafl, amasl, kfl, ksl)
	"HAB Average" => loxxexpandedsourcetypes.habaverage(smthtype, amafl, amasl, kfl, ksl)
    "HAB Average Median Body" => loxxexpandedsourcetypes.habavemedbody(smthtype, amafl, amasl, kfl, ksl)
	"HAB Trend Biased" => loxxexpandedsourcetypes.habtrendb(smthtype, amafl, amasl, kfl, ksl)
	"HAB Trend Biased (Extreme)" => loxxexpandedsourcetypes.habtrendbext(smthtype, amafl, amasl, kfl, ksl)
	=> haclose
	
ma = ta.sma(src, ssapernorm)
dev = ta.stdev(src, ssapernorm) * 3.0
calcno = (src - ma) / (math.max(dev, 0.000001))

out = 0.
arr = array.new_float(numbars + 1, 0)

for i = 0 to numbars - 1
    array.set(arr, i, nz(calcno[i]))

if last_bar_index - bar_index < backbars
    pv = fastsingular(arr, numbars, lag, ncomp) 
    out := array.get(pv, 0)

mid = 0

colorout = out > mid ? greencolor : out < mid ? redcolor : color.gray

plot(showraw ? calcno : na, color = color.white)

plot(last_bar_index - bar_index < backbars ? out : na, "EPSSANPO", color = colorout, linewidth = 2)
plot(last_bar_index - bar_index < backbars ? mid : na, "Mid", color = bar_index % 2 ? color.gray : na)

barcolor(last_bar_index - bar_index < backbars and colorbars ? colorout : na)

goLong = ta.crossover(out, mid)  
goShort =  ta.crossunder(out, mid)  

plotshape(showSigs and goLong, title = "Long", color = color.yellow, textcolor = color.yellow, text = "L", style = shape.triangleup, location = location.bottom, size = size.auto)
plotshape(showSigs and goShort, title = "Short", color = color.fuchsia, textcolor = color.fuchsia, text = "S", style = shape.triangledown, location = location.top, size = size.auto)

alertcondition(goLong, title = "Long", message = "End-pointed SSA of Normalized Price Oscillator [Loxx]: Long\nSymbol: {{ticker}}\nPrice: {{close}}")
alertcondition(goShort, title = "Short", message = "End-pointed SSA of Normalized Price Oscillator [Loxx]: Short\nSymbol: {{ticker}}\nPrice: {{close}}")



Code: Select all

 // 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
library("loxxexpandedsourcetypes", overlay = true)

_ama(src, len, fl, sl)=>
    flout = 2/(fl + 1)
    slout = 2/(sl + 1)
    hh = ta.highest(len + 1)
    ll = ta.lowest(len + 1)
    mltp = hh - ll != 0 ? math.abs(2 * src - ll - hh) / (hh - ll) : 0
    ssc = mltp * (flout - slout) + slout
    ama = 0.
    ama := nz(ama[1]) + math.pow(ssc, 2) * (src - nz(ama[1]))
    ama
    
_t3(src, len) =>
    xe1_1 = ta.ema(src, len)
    xe2_1 = ta.ema(xe1_1, len)
    xe3_1 = ta.ema(xe2_1, len)
    xe4_1 = ta.ema(xe3_1, len)
    xe5_1 = ta.ema(xe4_1, len)
    xe6_1 = ta.ema(xe5_1, len)
    b_1 = 0.7
    c1_1 = -b_1 * b_1 * b_1
    c2_1 = 3 * b_1 * b_1 + 3 * b_1 * b_1 * b_1
    c3_1 = -6 * b_1 * b_1 - 3 * b_1 - 3 * b_1 * b_1 * b_1
    c4_1 = 1 + 3 * b_1 + b_1 * b_1 * b_1 + 3 * b_1 * b_1
    nT3Average = c1_1 * xe6_1 + c2_1 * xe5_1 + c3_1 * xe4_1 + c4_1 * xe3_1
    nT3Average

_kama(src, len, kama_fastend, kama_slowend) =>
    xvnoise = math.abs(src - src[1])
    nfastend = kama_fastend
    nslowend = kama_slowend
    nsignal = math.abs(src - src[len])
    nnoise = math.sum(xvnoise, len)
    nefratio = nnoise != 0 ? nsignal / nnoise : 0
    nsmooth = math.pow(nefratio * (nfastend - nslowend) + nslowend, 2)
    nAMA = 0.0
    nAMA := nz(nAMA[1]) + nsmooth * (src - nz(nAMA[1]))
    nAMA
    
_trendreg(o, h, l, c)=>
    compute = 0.
    if (c > o)
        compute := ((h + c)/2.0)
    else  
        compute := ((l + c)/2.0)
    compute

_trendext(o, h, l, c) =>
    compute = 0.
    if (c > o) 
        compute := h
    else if (c < o) 
        compute := l
    else 
        compute := c
    compute    

// @function rClose: regular close
// @returns float
export rclose() => close 

// @function rClose: regular open
// @returns float
export ropen() => open

// @function rClose: regular high
// @returns float
export rhigh() => high

// @function rClose: regular low
// @returns float
export rlow() => low

// @function rClose: regular hl2
// @returns float
export rmedian() =>  hl2

// @function rClose: regular hlc3
// @returns float
export rtypical() =>  hlc3

// @function rClose: regular hlcc4
// @returns float
export rweighted() =>  hlcc4

// @function rClose: regular ohlc4
// @returns float
export raverage() =>  ohlc4

// @function rClose: median body
// @returns float
export ravemedbody() => (open + close)/2

// @function rClose: trend regular
// @returns float
export rtrendb() => _trendreg(ropen(), rhigh(), rlow(), rclose())

// @function rClose: trend extreme
// @returns float
export rtrendbext() => _trendext(ropen(), rhigh(), rlow(), rclose())



//heiken-ashi regular


// @function haclose: heiken-ashi close
// @param haclose float
// @returns float
export haclose(float haclose) => haclose

// @function haopen: heiken-ashi open
// @param haopen float
// @returns float
export haopen(float haopen) => haopen

// @function hahigh: heiken-ashi high
// @param hahigh float
// @returns float
export hahigh(float hahigh) => hahigh

// @function halow: heiken-ashi low
// @param halow float
// @returns float
export halow(float halow) => halow

// @function hamedian: heiken-ashi median
// @param hamedian float
// @returns float
export hamedian(float hamedian) => hamedian

// @function hatypical: heiken-ashi typical
// @param hatypical float
// @returns float
export hatypical(float hatypical) => hatypical

// @function haweighted: heiken-ashi weighted
// @param haweighted float
// @returns float
export haweighted(float haweighted) => haweighted

// @function haaverage: heiken-ashi average
// @param haweighted float
// @returns float
export haaverage(float haweighted) => haweighted

// @function haavemedbody: heiken-ashi median body
// @param haclose float
// @param haopen float
// @returns float
export haavemedbody(float haclose, float haopen) => (haopen(haopen) + haclose(haclose))/2

// @function hatrendb: heiken-ashi trend
// @param haclose float
// @param haopen float
// @param hahigh float
// @param halow float
// @returns float
export hatrendb(float haclose, float haopen, float hahigh, float halow) => _trendreg(haopen(haopen), hahigh(hahigh), halow(halow), haclose(haclose))

// @function hatrendext: heiken-ashi trend extreme
// @param haclose float
// @param haopen float
// @param hahigh float
// @param halow float
// @returns float
export hatrendbext(float haclose, float haopen, float hahigh, float halow) => _trendext(haopen(haopen), hahigh(hahigh), halow(halow), haclose(haclose))



//heiken-ashi better

_habingest() => 
    out =  (ropen() + rclose())/2 + (((rclose() - ropen())/(rhigh() - rlow())) * math.abs((rclose() - ropen())/2))
    out := na(out) ? rclose() : out
    out
// @function habclose: heiken-ashi better open
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export habclose(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    amaout = _ama(_habingest(), 2, amafl, amasl)
    t3out = _t3(_habingest(), 3)
    kamaout = _kama(_habingest(), 2, kfl, ksl)
    smthtype == "AMA" ? amaout : smthtype == "T3" ? t3out : kamaout

// @function habopen: heiken-ashi better open
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export habopen(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    habopen = 0.
    habopen := na(habopen[1]) ? (nz(habopen) + nz(habclose(smthtype, amafl, amasl, kfl, ksl)[1]))/2 : (nz(habopen[1]) + nz(habclose(smthtype, amafl, amasl, kfl, ksl)[1]))/2
    habopen 

// @function habhigh: heiken-ashi better high
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export habhigh(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    math.max(rhigh(), habopen(smthtype, amafl, amasl, kfl, ksl), habclose(smthtype, amafl, amasl, kfl, ksl))
    
// @function hablow: heiken-ashi better low
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export hablow(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    math.min(rlow(), habopen(smthtype, amafl, amasl, kfl, ksl), habclose(smthtype, amafl, amasl, kfl, ksl))
    
// @function habmedian: heiken-ashi better median
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export habmedian(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    (habhigh(smthtype, amafl, amasl, kfl, ksl) + hablow(smthtype, amafl, amasl, kfl, ksl))/2
    
// @function habtypical: heiken-ashi better typical
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float
export habtypical(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    (habhigh(smthtype, amafl, amasl, kfl, ksl) + hablow(smthtype, amafl, amasl, kfl, ksl) + habclose(smthtype, amafl, amasl, kfl, ksl))/3

// @function habweighted: heiken-ashi better weighted
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float    
export habweighted(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    (habhigh(smthtype, amafl, amasl, kfl, ksl) + hablow(smthtype, amafl, amasl, kfl, ksl) + habclose(smthtype, amafl, amasl, kfl, ksl) + habclose(smthtype, amafl, amasl, kfl, ksl))/4

// @function habaverage: heiken-ashi better average
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float 
export habaverage(string smthtype, int amafl, int amasl, float kfl, float ksl) => //ohlc4
    (habopen(smthtype, amafl, amasl, kfl, ksl) + habhigh(smthtype, amafl, amasl, kfl, ksl) + hablow(smthtype, amafl, amasl, kfl, ksl) + habclose(smthtype, amafl, amasl, kfl, ksl))/4

// @function habavemedbody: heiken-ashi better median body
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float   
export habavemedbody(string smthtype, int amafl, int amasl, float kfl, float ksl) => //oc2
    (habopen(smthtype, amafl, amasl, kfl, ksl) + habclose(smthtype, amafl, amasl, kfl, ksl))/2

// @function habtrendb: heiken-ashi better trend
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float   
export habtrendb(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    _trendreg(habopen(smthtype, amafl, amasl, kfl, ksl), habhigh(smthtype, amafl, amasl, kfl, ksl), hablow(smthtype, amafl, amasl, kfl, ksl), habclose(smthtype, amafl, amasl, kfl, ksl))

// @function habtrendbext: heiken-ashi better trend extreme
// @param smthtype string
// @param amafl int
// @param amasl int
// @param kfl int
// @param ksl int
// @returns float 
export habtrendbext(string smthtype, int amafl, int amasl, float kfl, float ksl) => 
    _trendext(habopen(smthtype, amafl, amasl, kfl, ksl), habhigh(smthtype, amafl, amasl, kfl, ksl), hablow(smthtype, amafl, amasl, kfl, ksl), habclose(smthtype, amafl, amasl, kfl, ksl))


//example ussage

habcloser = habclose("AMA", 6, 20, 5, 25) 
plot(habcloser)
Attachments
0 + 0 = 0
Infinite / Infinite = 1
1 way to Heaven & it matters

Re: MT4 Trading Systems (Old or new!) Please post here

557
;)
These users thanked the author Jedidiah for the post:
Chickenspicy
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.

Re: MT4 Trading Systems (Old or new!) Please post here

559
These users thanked the author Jedidiah for the post (total 2):
Chickenspicy, SijjiN
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.

Re: MT4 Trading Systems (Old or new!) Please post here

560
HMA ATR Channel with Heiken Ashi smoothed by HMA
These users thanked the author Banzai for the post (total 3):
Chickenspicy, thomdel, Jedidiah


Who is online

Users browsing this forum: DotNetDotCom [Bot], fnz, Hunter45, MarcoGee and 112 guests