Change from tradingview to Mt5

MQL5 Indicators

Specification

Request someone to change a tradingview script to mt5 code 


//@version=4

study("Renko Chart", overlay=true, max_bars_back = 4900)

mode =input(title = "Method", defval = 'ATR', options=['Traditional', 'ATR'])

modevalue = input(title ="[ATR] Atr Period", defval = 14, minval = 1)

boxsize = input(title ="[Traditional] Brick Size", defval = 10.0, minval = 0.000000000000001)

source =input(defval = "hl", title = "Source", options=['close', 'hl'])

showstyle =input(title = "Chart Style As", defval = 'Area', options=['Candle', 'Area', 'Dont Show'])

breakoutcolor = input(defval = 'Blue/Red', title = "Color Theme", options =['Green/Red', 'Yellow/Blue', 'White/Yellow', 'Orange/Blue', 'Lime/Red', 'Blue/Red'])

changebarcol = input(true, title = "Change Bar Colors")


//calc atr val

conv_atr(valu)=>

    a = 0

    num = syminfo.mintick

    s = valu

    if na(s)

        s := syminfo.mintick

    if num < 1

        for i = 1 to 20

            num := num * 10

            if num > 1

                break

            a := a +1

    for x = 1 to a 

        s := s * 10

    s := round(s)

    for x = 1 to a

        s := s / 10

    s := s < syminfo.mintick  ? syminfo.mintick : s

    s


//ATR box size calculation

atrboxsize = conv_atr(atr(modevalue))



float box = na

box := na(box[1]) ? mode == 'ATR' ? atrboxsize : boxsize : box[1] 


reversal = 2

top = 0.0, bottom = 0.0

trend = 0

trend := barstate.isfirst ? 0 : nz(trend[1])

currentprice = 0.0

currentprice := source == 'close' ? close : trend == 1 ? high : low

float beginprice = na

beginprice := barstate.isfirst ? floor(open / box) * box : nz(beginprice[1])

iopenprice = 0.0

icloseprice = 0.0


if trend == 0 and box * reversal <= abs(beginprice - currentprice)

    if beginprice > currentprice

        numcell = floor(abs(beginprice - currentprice) / box)

        iopenprice := beginprice

        icloseprice := beginprice - numcell * box

        trend := -1

    if beginprice < currentprice

        numcell = floor(abs(beginprice - currentprice) / box)

        iopenprice := beginprice

        icloseprice := beginprice + numcell * box

        trend := 1


if trend == -1

    nok = true

    if beginprice > currentprice and box <= abs(beginprice - currentprice)

        numcell = floor(abs(beginprice - currentprice) / box)

        icloseprice := beginprice - numcell * box

        trend := -1

        beginprice := icloseprice

        nok := false

    else

        iopenprice := iopenprice == 0 ? nz(iopenprice[1]) : iopenprice

        icloseprice := icloseprice == 0 ? nz(icloseprice[1]) : icloseprice

    

    tempcurrentprice = source == 'close' ? close : high

    if beginprice < tempcurrentprice and box * reversal <= abs(beginprice - tempcurrentprice) and nok //new column

        numcell = floor(abs(beginprice - tempcurrentprice) / box)

        iopenprice := beginprice + box

        icloseprice := beginprice + numcell * box

        trend := 1

        beginprice := icloseprice

    else

        iopenprice := iopenprice == 0 ? nz(iopenprice[1]) : iopenprice

        icloseprice := icloseprice == 0 ? nz(icloseprice[1]) : icloseprice

else        

    if trend == 1

        nok = true

        if beginprice < currentprice and box <= abs(beginprice - currentprice)

            numcell = floor(abs(beginprice - currentprice) / box)

            icloseprice := beginprice + numcell * box

            trend := 1

            beginprice := icloseprice

            nok := false

        else

            iopenprice := iopenprice == 0 ? nz(iopenprice[1]) : iopenprice

            icloseprice := icloseprice == 0 ? nz(icloseprice[1]) : icloseprice

    

        tempcurrentprice = source == 'close' ? close : low

        if beginprice > tempcurrentprice and box * reversal <= abs(beginprice - tempcurrentprice) and nok //new column

            numcell = floor(abs(beginprice - tempcurrentprice) / box)

            iopenprice := beginprice - box

            icloseprice := beginprice - numcell * box

            trend := -1

            beginprice := icloseprice

        else

            iopenprice := iopenprice == 0 ? nz(iopenprice[1]) : iopenprice

            icloseprice := icloseprice == 0 ? nz(icloseprice[1]) : icloseprice    


//if icloseprice changed then recalculate box size

box := change(icloseprice) ?  mode == 'ATR' ? atrboxsize :  boxsize : box


upcolor = breakoutcolor == 'Green/Red' ? color.green :  breakoutcolor == 'White/Yellow' ? color.white : breakoutcolor == 'Lime/Red' ? color.lime : breakoutcolor == 'Blue/Red' ? color.blue : breakoutcolor == 'Yellow/Blue' ? color.yellow : color.orange

downcolor = breakoutcolor == 'Yellow/Blue' or breakoutcolor == 'Orange/Blue' ? color.blue : breakoutcolor == 'Green/Red' or breakoutcolor == 'Lime/Red' or breakoutcolor == 'Blue/Red'? color.red : color.yellow


oprice = 

   trend == 1 ? nz(trend[1]) == 1 ? nz(icloseprice[1]) - nz(box[1]) : nz(icloseprice[1]) + nz(box[1]) : 

   trend == -1 ? nz(trend[1]) == -1 ? nz(icloseprice[1]) + nz(box[1]) : nz(icloseprice[1]) - nz(box[1]) :

   nz(icloseprice[1]) 

oprice := oprice < 0 ? 0 : oprice


openline = plot(showstyle == 'Area' and  oprice > 0? oprice : na, title = "Renko Open", color = oprice < 0 or oprice[1] < 0 ? na : color.gray, editable = false)

closeline = plot(showstyle == 'Area' and icloseprice > 0 ? icloseprice : na, title = "Renko Close", color = icloseprice <= 0 or icloseprice[1] <= 0 ? na : color.gray, editable = false)

fill(openline, closeline, color = oprice <= 0 and icloseprice <=0 ? na : trend == 1 ? upcolor : downcolor, transp = 70, editable = false)

plotcandle(showstyle == 'Candle' ? oprice : na, showstyle == 'Candle' ? max(oprice, icloseprice) : na, showstyle == 'Candle' ? min(oprice , icloseprice) : na, showstyle == 'Candle'? icloseprice : na, title='Renko Candles', color = trend == 1 ? upcolor : downcolor, editable = false)


barcolor(changebarcol ? trend == 1 ? upcolor : downcolor : na, editable = false)


//keep last close/open price

float lasticloseprice = na

lasticloseprice := change(icloseprice) ? icloseprice[1] : nz(lasticloseprice[1])


// keep old columns

float chigh = na

float clow = na

ctrend = 0

chigh := change(trend) ? max(iopenprice[1], icloseprice[1]) : na

clow := change(trend) ? min(iopenprice[1], icloseprice[1]) : na

ctrend := change(trend) ? trend[1] : na


// ============== breakout strategy ============== added by user request

Length = input(title = "Length for Breakout", type = input.integer, minval = 1, defval = 1)

showbreakout = input(title = "Show Breakout Trend", defval = true)


f_Brickhigh()=>

    _ret = false

    if trend ==  1

        _l = floor((icloseprice - iopenprice) / box) - 1 

        _ret := true

        if _l < Length

            for x = 0 to 3000

                if na(trend[x+1])

                    _ret := false

                    break

                if trend[x] != trend[x+1]

                    if trend[x+1] == 1

                        if icloseprice[x+1] >= icloseprice

                            _ret := false

                            break

                        _l := _l + (floor((icloseprice[x+1] - iopenprice[x+1]) / box[x+1]))

                        

                    if trend[x+1] == -1

                        start = icloseprice[x+1] + box[x+1]

                        forlen = floor((iopenprice[x+1] - icloseprice[x+1]) / box) - 1

                        for i = 0 to forlen

                            if start < icloseprice

                                _l := _l + 1

                            start := start + box[x+1]

                    if _l >= Length

                        _ret := true

                        break

    _ret


f_Bricklow()=>

    _ret = false

    if trend == -1

        _l = floor((iopenprice - icloseprice) / box) - 1 

        _ret := true

        if _l < Length

            for x = 0 to 3000

                if na(trend[x+1])

                    _ret := false

                    break

                if trend[x] != trend[x+1]

                    if trend[x+1] == -1

                        if icloseprice[x+1] <= icloseprice

                            _ret := false

                            break

                        _l := _l + (floor((iopenprice[x+1] - icloseprice[x+1]) / box[x+1]))

                        

                    if trend[x+1] == 1

                        start = icloseprice[x+1] - box[x+1]

                        forlen = floor((icloseprice[x+1] - iopenprice[x+1]) / box) - 1

                        for i = 0 to forlen

                            if start > icloseprice

                                _l := _l + 1

                            start := start - box[x+1]

                    if _l >= Length

                        _ret := true

                        break

    _ret



Brickhigh = f_Brickhigh()

Bricklow = f_Bricklow()


switch = 0

setA = 0

setB = 0


if Brickhigh and switch[1] == 0

    switch := 1

    setA := 1

    setB := 0

    setB

else

    if Bricklow and switch[1] == 1

        switch := 0

        setA := 0

        setB := 1

        setB

    else

        switch := nz(switch[1], 0)

        setA := 0

        setB := 0

        setB


botrend = 0

botrend := setA == 1 ? 1 : setB == 1 ? -1 : nz(botrend[1])


boline = showbreakout ? botrend == 1 ? trend == 1 ? icloseprice : oprice :  trend == 1 ? oprice : icloseprice : na

       

plot(boline, title = "Renko breakout", color = showbreakout ? botrend == 1 ? color.lime : botrend == -1 ? color.red : na : na, linewidth = 3, editable = false, transp = 0)

alertcondition(setA == 1, title='Breakout Uptrend started', message='Breakout Uptrend started')

alertcondition(setB == 1, title='Breakout Downtrend started', message='Breakout Downtrend started')


//============= enf of breakout strategy ===================


// Trend

showtrend = input(true, title="Show Trend")

showtrhold = input(true, title="Show Threshold")

tremalen = input(defval = 34, title="Trend EMA Length", minval = 1)

barcountwhip = input(defval = 3, title="Wait # Bars for Reversal", minval = 0)

thsreversal = input(defval = 3.0, title="Trend Threshold", minval = 0, step = 0.1)

thsreversal2 = input(defval = 1.5, title="Trend Threshold for Reversal", minval = 0, step = 0.1)


trcnt1 = 0

trcnt1 := change(icloseprice) ? 1 : nz(trcnt1[1]) + 1

trcnt1 := trcnt1 > 4000 ? 4000 : trcnt1

countch = 0

countch := change(icloseprice) ? nz(countch[1]) + 1 : nz(countch[1])

trch = false

trch := change(trend) and change(icloseprice) ? true : change(trend)==0 and change(icloseprice) ? false : nz(trch,false)


mysma(ser, len) =>

    sum = ser

    nn = 1

    if len > 1

        for i = 0 to 4000

            if nz(ser[i]) ==0 or nz(ser[i+1]) ==0

                break

            if ser[i] != nz(ser[i+1])

                nn := nn + 1

                sum := sum + nz(ser[i+1])

                if nn == len

                    break

    _ret = nn == len ? sum / len : na


myema(ser, len, trcnt, obox)=>

    float em = na

    if countch <= len 

        em := mysma(ser, len)

    if countch > len and not na(ser[trcnt]) and ser != nz(ser[trcnt])

        float alpha = 2 / (len + 1)

        bb = ser > nz(ser[trcnt]) ? 1 : -1

        kats = trch ? reversal : 1

        st = nz(ser[trcnt]) + bb * obox * kats

        em := alpha * st + (1 - alpha) * nz(em[trcnt]) // for the first one

        st := st + bb * obox

        for x = 0 to 4000

            if st > ser and bb > 0 or st < ser and bb < 0

                break

            em := alpha * st + (1 - alpha) * nz(em) // for other boxes

            st := st + bb * obox

    em := na(em) ? em[1] : em


float tema = na

float obox = na

obox := change(icloseprice) != 0 ? nz(box[1]) : nz(obox[1])

tmp = myema(icloseprice, tremalen, trcnt1, obox)

tema := icloseprice - floor((icloseprice - tmp) / obox) * obox


Upt = tema - thsreversal * box

Upt := Upt > icloseprice - reversal * box ? icloseprice - reversal * box : Upt

Dnt = tema + thsreversal * box

Dnt := Dnt < icloseprice + reversal * box ? icloseprice + reversal * box : Dnt


float TrendUp = na, float TrendDown = na

waitit = 0

waitit := nz(waitit[1])

mtrend = 0

mtrend := nz(mtrend[1],1)

TrendUp  := change(icloseprice) and waitit == 0 ? icloseprice[1] > TrendUp[1] ? max(Upt, TrendUp[1]) : Upt : nz(TrendUp[1])

TrendUp := mtrend == 1 and change(TrendUp) < 0 ? nz(TrendUp[1]) : TrendUp

TrendDown:= change(icloseprice) and waitit == 0  ? icloseprice[1] < TrendDown[1] ? min(Dnt, TrendDown[1]) : Dnt : TrendDown[1]

TrendDown := mtrend == -1 and change(TrendDown) > 0 ? nz(TrendDown[1]) : TrendDown


mtrend := waitit == 0 ? icloseprice > TrendDown[1] ? 1 : icloseprice < TrendUp[1]? -1 : mtrend : mtrend


if change(mtrend) != 0 and waitit == 0 and nz(waitit[2]) == 0

    waitit := 1

else

    waitit := waitit != 0 ? waitit + 1 : waitit


if waitit > 0

    mtrend := nz(mtrend[1])


if waitit > barcountwhip

    if mtrend == 1

        if icloseprice >= TrendUp + thsreversal2 * box

            waitit := 0

        if icloseprice <= TrendUp - thsreversal2 * box

            waitit := 0

            mtrend := -1

            TrendDown:= icloseprice[1] < TrendDown[1] ? min(Dnt, TrendDown[1]) : Dnt

    else

        if icloseprice <= TrendDown - thsreversal2 * box

            waitit := 0

        if icloseprice >= TrendDown + thsreversal2 * box

            waitit := 0

            mtrend := 1

            TrendUp  := icloseprice[1] > TrendUp[1] ? max(Upt, TrendUp[1]) : Upt


Tsl = mtrend==1 ? TrendUp : TrendDown

Tsl2 = mtrend==1 ? TrendUp + thsreversal * box: TrendDown - thsreversal * box

Tsl2 := (mtrend==1 and Tsl2 > icloseprice) or (mtrend==-1 and Tsl2 < icloseprice)? icloseprice : Tsl2 

Tsl2 :=Tsl2 < 0 ? 0 : Tsl2


trendcol = mtrend == 1 and nz(mtrend[1]) == 1 ? waitit == 0 ? color.green : color.silver : mtrend == -1 and nz(mtrend[1]) == -1 ? waitit == 0 ? color.red : color.silver : na


trendline = plot(Tsl, linewidth = 3, color = showtrend and Tsl !=0 and nz(Tsl[1]) !=0 ? trendcol : na, transp = 0, editable = false)

trcol = showtrend and showtrhold and mtrend == nz(mtrend[1]) and Tsl !=0 and nz(Tsl[1]) !=0 ? waitit == 0 ? mtrend == 1 ? color.new(color.lime, 80) : color.new(color.red, 80) : color.new(color.yellow, 80) : color.new(color.white, 100)

trcol1 = showtrend and showtrhold and Tsl !=0 and nz(Tsl[1]) !=0 ? color.new(color.gray, 30) : color.new(color.white, 100)

trline = plot(Tsl2, linewidth = 1, style = plot.style_circles, color = na, editable = false)

fill(trendline, trline, color =trcol, editable = false)


// trend reversal threshold line

plot(waitit > barcountwhip? mtrend == 1 ? TrendUp - thsreversal2 * box : TrendDown + thsreversal2 * box : na, color = waitit > barcountwhip ? color.maroon : na, style = plot.style_circles, editable = false)


plot(change(mtrend) > 0 and showtrend or change(mtrend) < 0 and showtrend ? Tsl : na, linewidth = 6, color = change(mtrend) > 0 and showtrend ? color.green : color.red, style = plot.style_circles, editable = false)


alertcondition(change(mtrend) > 0, title='Main Trend is Up', message='Main Trend is Up')

alertcondition(change(mtrend) < 0, title='Main Trend is Down', message='Main Trend is Down')

alertcondition(change(trend) > 0, title='Renko Trend is Up', message='Renko Trend is Up')

alertcondition(change(trend) < 0, title='Renko Trend is Down', message='Renko Trend is Down')



Responded

1
Developer 1
Rating
(412)
Projects
543
75%
Arbitration
9
44% / 0%
Overdue
24
4%
Free
2
Developer 2
Rating
(1)
Projects
2
0%
Arbitration
0
Overdue
0
Free
3
Developer 3
Rating
(839)
Projects
1430
72%
Arbitration
117
29% / 47%
Overdue
354
25%
Working
Published: 3 articles
Similar orders
Hallo, ich suche einen erfahrenen MT5-Programmierer, der mir einen Key Structure Range Indikator auf Basis von 3er-Fractals erstellt, inkl. Buffers für spätere EA-Nutzung. Pflichtenheft - Key Structure Range Indikator für MT5 (EA-ready): Projektbezeichnung: "Key Structure Range Indikator für MT5 (EA-ready)" 1. Plattform - MetaTrader 5 (MT5) - Unterstützte Timeframes: M1 bis H12 2. Kerneigenschaften (unbedingt
Hello everyone. I want to reproduce the indicator attached as picture but for Metatrader5. They are differents things to implement: 1- The BUY / SELL logic with their level of stop loss and take profit 2- A system on chart that show the levels, similar from what i have on the picture. I know that we can't have exactly this from metatrader so suggest me things. 3- Ovveride bar colors when we are on a signal. For BUYS
Mt5 indicator 50+ USD
hello great developer Hi, I need another indicator for MT5 from you, please. The indicator is as follows: As soon as three wicks of a candle reach the same price but then retreat, leaving a wick behind, a yellow line should appear between the wicks. There must be at least three wicks. There can be more than one, but no fewer than three. And please set an alert as soon as a yellow line appears. I've attached a PDF
I have an account on (MT4 AxiTrader) I need some support from you I need to add a bank account on the Client Portal. Once its verify my bank account, I can submit a withdrawal. If you can do that for me then send me an offer please If you can can help how to add a bank account on the (Client Portal) please I will be very appreciate
אני זקוק למומחה שיצור יועץ מומחה למגמת העל בדיוק כפי שהוא בתצוגת מסחר וזה גם יופיע בגרף בדיוק כפי שהוא בתצוגת המסחר, כולל האותות וקווי המגמה שיעבדו מעסקה לעסקה, אך יש להם גם אפשרות להפעיל ולכבות סטופ לוס, קח רווח, סטופ נגרר, גודל יח' ואותן הגדרות המופיעות במחוון בתצוגת מסחר. תודה רבה :))
I need a professional programmer in MT5 and must be experienced in building structured to do the task. My MT5 ea has been done but a few bugs need to be fixed and i have the source code. I want the job do be done in 2 to 3 days or don't waste our time. What to do 1. EA open trades must follow the sequence even when manual trade/Hedging trade is open 2. If there are no normal buys or sells, hedging buy or sell alone
HELLO GREAT DEVELOPER Hi, I'm looking for an experienced NinjaTrader 8 developer to complete an automated trading strategy. All custom indicators (4) are done, and I have a full spec document. I just need the strategy logic finalized—entry/exit rules, integration, position management, and testing. There’s a partial strategy file ready. Please let me know your availability, experience with multi-timeframe logic, and
to compile all the suitable markets for buy and place a buy for the shortest timeframe and place a sell for also a shortest timeframe it should work with all brokers and can automatically place a trade as long as its connected to the internet it should inform where the contracts are placed and for how long
I need an experienced Pine Script v5 developer to help finalize and package a custom strategy that has already been partially converted from TradeStation EasyLanguage. The core logic uses four key technical indicators: MACD crossover Chaikin Oscillator (volume-based) Directional Movement Index (DMI +/- crossover) Simple Moving Averages (SMA) Project Scope: 1. Fix and clean the current Pine Script code 2. Implement
Hello, I'm currently seeking a skilled and reliable MQL4 developer to assist in modifying and enhancing my Expert Advisor, Reversal Master V10.1 , to its next version V12.1 FF . This update involves integrating several advanced third-party indicators and implementing new trading logic based on clearly defined conditions to improve performance and strategy precision. If you have experience in EA development and enjoy

Project information

Budget
50+ USD
For the developer
45 USD
Deadline
from 1 day(s)