Need a quick conversion of an indicator to MT4 indicator

MQL4 Indicadores Conversión

Trabajo finalizado

Plazo de ejecución 6 días

Tarea técnica

//@version=5
indicator("The LI",overlay=true,max_lines_count = 500, max_labels_count = 500)

Mode2 = true
Mode3 = true
MaxLines = input(25)
RemoveLabelWhenLineIsBroken = input(true)

LineC1 = input.color(color.black,"High Line",inline='l1',group="UI Settings")
LineT1 = input.string("Solid","Style",options=["Solid","Dashed","Dotted"],inline='l1',group="UI Settings")
LineW1 = input.int(1,"Width",minval=1,inline='l1',group="UI Settings")

LineC2 = input.color(color.black,"Low Line",inline='l2',group="UI Settings")
LineT2 = input.string("Solid","Style",options=["Solid","Dashed","Dotted"],inline='l2',group="UI Settings")
LineW2 = input.int(1,"Width",minval=1,inline='l2',group="UI Settings")

HighLabel = input.string("xcross",options=["none","xcross","cross","circle","diamond","square","flag" ,"arrowdown","arrowup","triangleup","triangledown"],group="UI Settings",inline='hl1')
Color1 = input(color.red,"",inline='hl1',group="UI Settings")
LowLabel = input.string("xcross",options=["none","xcross","cross","circle","diamond","square","flag" ,"arrowdown","arrowup","triangleup","triangledown"],group="UI Settings",inline='hl2')
Color2 = input(color.red,"",inline='hl2',group="UI Settings")
LabelSize = input.string("Auto",options=["Auto","Huge","Large","Normal","Small","Tiny"],group="UI Settings")

LineText1 = input.string("","High Text",inline='lt1',group="Line Text")
LineTextColor1 = input.color(color.red,"",inline='lt1',group="Line Text")
LineTextAlign1 = input.string("Center","Align",options=['Center','Left','Right'],inline='lt1',group="Line Text")
LineTextSize1 = input.string("Normal","Size",options=["Auto","Huge","Large","Normal","Small","Tiny"],inline='lt1',group="Line Text")

LineText2 = input.string("","Low Text",inline='lt2',group="Line Text")
LineTextColor2 = input.color(color.red,"",inline='lt2',group="Line Text")
LineTextAlign2 = input.string("Center","Align",options=['Center','Left','Right'],inline='lt2',group="Line Text")
LineTextSize2 = input.string("Normal","Size",options=["Auto","Huge","Large","Normal","Small","Tiny"],inline='lt2',group="Line Text")

LabelSizesToEnum(s) =>
    switch s
        "Auto" => size.auto
        "Huge" => size.huge
        "Large" => size.large
        "Normal" => size.normal
        "Small" => size.small
        "Tiny" => size.tiny

LabelStylesToEnum(s) =>
    switch s
        "xcross" => label.style_xcross
        "cross" => label.style_cross
        "circle" => label.style_circle
        "diamond" => label.style_diamond
        "square" => label.style_square
        "flag" => label.style_flag
        "arrowdown" => label.style_arrowdown
        "arrowup" => label.style_arrowup
        "triangleup" => label.style_triangleup
        "triangledown" => label.style_triangledown
        "none" => label.style_none
        
StyleToEnum(s) =>
    switch s
        "Solid" => line.style_solid
        "Dashed" => line.style_dashed
        "Dotted" => line.style_dotted

RedCandle = close < open
GreenCandle = close > open

StandHigh = high[1] >= high and high[1] >= high[2]
StandLow = low[1] <= low and low[1] <= low[2]

TFUpdateNeeded(tf) =>
    if timeframe.period == '1'
        ta.barssince(ta.change(time(tf))) == 0
    else
        v_xx1 = ta.barssince(ta.change(time(tf)) != 0 ? true : false)
        var float v_xx2 = na
        if v_xx1 == 0
            v_xx2 := v_xx1[1]
        v_xx2==v_xx1
    
var Levels = array.new<float>()
var Levels_t = array.new<int>()
var Levels_c = array.new<int>()

dt = time - time[1]

AddLevel(p,t,c) =>
    array.push(Levels,p)
    array.push(Levels_t,t)
    array.push(Levels_c,c)

if Mode2
    if StandHigh
        AddLevel(high[1],time[1],1)
        label.new(time[1],high[1],yloc=yloc.abovebar,xloc=xloc.bar_time,style=LabelStylesToEnum(HighLabel),size=LabelSizesToEnum(LabelSize),color=Color1)
        
    if StandLow
        AddLevel(low[1],time[1],2)
        label.new(time[1],low[1],yloc=yloc.belowbar,xloc=xloc.bar_time,style=LabelStylesToEnum(LowLabel),size=LabelSizesToEnum(LabelSize),color=Color2)
    
    
var int lastRed = 0
var int lastGreen = 0

if Mode3
    if GreenCandle[2]
        if high[2] > high[1] and low[2] > low
            i = 2
            label.new(time[i],high[i],yloc=yloc.abovebar,xloc=xloc.bar_time,style=LabelStylesToEnum(HighLabel),size=LabelSizesToEnum(LabelSize),color=Color1)
            array.push(Levels,high[i])
            array.push(Levels_t,time[i])
            array.push(Levels_c,1)
    
    
    if RedCandle[2]
        if low[2] < low[1] and high[2] < high
            i = 2
            label.new(time[i],low[i],yloc=yloc.belowbar,xloc=xloc.bar_time,style=LabelStylesToEnum(LowLabel),size=LabelSizesToEnum(LabelSize),color=Color2)
            array.push(Levels,low[i])
            array.push(Levels_t,time[i])
            array.push(Levels_c,2)


CandleIsTouching(x) =>
    low < x and high > x
    
DeleteLabelForline(l) =>
    bi = line.get_x1(l)
    a_allLabels = label.all
    if array.size(a_allLabels) > 0
    for i = 0 to array.size(a_allLabels) - 1
        lbl = array.get(a_allLabels, i)
        if label.get_x(lbl) == bi
        label.delete(lbl)

DrawText(t1,t2,p,txt,align,c,s) =>
    if str.length(txt) > 0
        len = math.abs(t1 - t2) / dt
        if align == 'Center'
            label.new(t1+len*dt/2,p,txt,xloc=xloc.bar_time,style=label.style_none,textcolor=c,textalign=text.align_center,size=s)
        else if align == 'Left'
            label.new(t1,p,txt,xloc=xloc.bar_time,style=label.style_none,textcolor=c,textalign=text.align_center,size=s)
        else if align == 'Right'
            label.new(t2,p,txt,xloc=xloc.bar_time,style=label.style_none,textcolor=c,textalign=text.align_center,size=s)

bool looper = true
varip int LastAlertT = 0
while looper
    looper := false
    if array.size(Levels) > 0
        for i = 0 to array.size(Levels) - 1
            lvl = array.get(Levels,i) 
            t = array.get(Levels_t,i) 
            c = array.get(Levels_c,i) 
            if CandleIsTouching(lvl)
                len = (time - t) / dt
                
                if len >= 1
                    ln = if c == 1
                        DrawText(t,time,lvl,LineText1,LineTextAlign1,LineTextColor1,LabelSizesToEnum(LineTextSize1))
                        line.new(t,lvl,time,lvl,xloc=xloc.bar_time,color=LineC1,style=StyleToEnum(LineT1),width=LineW1)
                    else if c == 2 
                        DrawText(t,time,lvl,LineText2,LineTextAlign2,LineTextColor2,LabelSizesToEnum(LineTextSize2))
                        line.new(t,lvl,time,lvl,xloc=xloc.bar_time,color=LineC2,style=StyleToEnum(LineT2),width=LineW2)
                    if RemoveLabelWhenLineIsBroken
                        DeleteLabelForline(ln)

                if time - LastAlertT > 1000*5
                    LastAlertT := time
                    if c == 1
                        alert(syminfo.ticker + " High Taken [" + timeframe.period + "]",alert.freq_all)
                    else
                        alert(syminfo.ticker + " Low Taken [" + timeframe.period + "]",alert.freq_all)
                    
                array.remove(Levels,i)
                array.remove(Levels_t,i)
                array.remove(Levels_c,i)
                looper := true
                break

if barstate.islast
    Arr = line.all
    
    while array.size(line.all) > MaxLines
        //remove the oldest line
        int oldT = na
        int OldIdx = na
        if array.size(Arr) > 0
            for i = 0 to array.size(Arr)-1
                l = array.get(Arr,i)
                lx1 = line.get_x1(l)
                if na(oldT)
                    oldT := lx1
                    OldIdx := i
                else
                    if oldT > lx1
                        oldT := lx1
                        OldIdx := i
            if not na(OldIdx)
                lbl = array.get(Arr,OldIdx)
                DeleteLabelForline(lbl)
                line.delete(lbl)

Han respondido

1
Desarrollador 1
Evaluación
(56)
Proyectos
92
62%
Arbitraje
0
Caducado
4
4%
Libre
Solicitudes similares
Hi everyone I have a question, is there anyone who can rewrite the code from tradinvivew pineditor to mql5 meta trader? It is about 150 line. My strategy has 50% success rate with RR 2,6. Tested for last one year, strategy works only in bull market. This is trading on gold, unfortunately I am not in the best financial position, in return I would send you the code, if you don't like it I understand that you will stop
Hello I have an indicator here which is based on the crosses...if two lines crossing for buy it must change all candles on the main chart to be green, If two lines crossing for sell it must change all candles to red...Main Chart candles to change color(s) must be controlled by the cross indicator
I need help on my project. Retrieve US30 asset price data from Ctrader Convert it to YM futures data Display the converted data on TradingView The reason why I need to convert US30 cfd prices from Ctrader into YM future prices is because all of my trading signals are from ctrader, and i need to trade on tradingview. Thanks
CTRADER 30+ USD
can you help me with this project? Retrieve US30 asset price data from Ctrader Convert it to YM futures data Display the converted data on TradingView The reason why I need to convert US30 cfd prices from Ctrader into YM future prices is because all of my trading signals are from ctrader, and i need to trade on tradingview. Thanks
I need help with a small project. Basically I need to convert us30 asset price on Ctrader platform into YM futures on tradingview. Can you do it? It should be quite straight forward this is an example of what my trade signals look like
Skarito98 30 - 100 USD
Always stay winning and survive....we all want a better life now this is a chance someone can take,to change their lives for the better.No one is supposed to suffer in this world,we create and invert new things and come up with ideas to solve situations we come across especially when it comes to finance. We all need better things in life and God want good things for us
hello i need a professional to convert a fully functioning buy and sell signal strategy on tradingview to EA mt4 , the signals trigger when the bar closed match all conditions , it has a specific calculation for strength of each pair
Attached is a ThinkScript Strategy. I would like to convert it into an Expert Advisor for MQL4. Here is a link of a PineScript code for a similar indicator. This is just to give you additional info about the indicator, hence helping you to convert it from Thinkscript to MQL4
Only with feedbacks 30 - 100 USD
PINESCRIPT->MQL4 i need a exactly conversion of the file attached to mql4 with source code (i need the source code), obviously as indicator for mt4 let me know your bid and timeline
C onversion from Ninjatrader to Tradingview. This includes thorough testing and debugging to guarantee that the script functions as intended on Tradingview...If you are in for this job kindly bid

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD
Plazo límite de ejecución
a 1 día(s)