TradingView scalping code conversion – please help

Forums ProRealTime English forum ProBuilder support TradingView scalping code conversion – please help

Viewing 1 post (of 1 total)
  • #174480

    Hi, would anyone be able to help convert the Trading view code to ProRealtime? I use it to scalp?

    Many thanks

    James

    //@version=4
    //Coded by Naan_Deal
    study(“Trend Signal”, overlay=true)
    //Bollinger Bands
    MA1 = input(21)
    moving_average1 = sma(close, MA1)
    matype1 = input(1, minval=1, maxval=5)
    avgval1 = matype1==1 ? moving_average1 : na
    color1 = avgval1 > avgval1[1] ? color.blue : color.orange
    plot(moving_average1, color=color1, linewidth=2, transp=0, title=”21 SMA”)
    MA2 = input(8)
    moving_average2 = ema(close, MA2)
    matype2 = input(1, minval=1, maxval=5)
    avgval2 = matype2==1 ? moving_average2 : na
    color2 = avgval2 > avgval2[1] ? color.green : color.red
    plot(moving_average2, color=color2, linewidth=2, transp=0, title=”8 EMA”)
    MA3 = input(13)
    moving_average3 = ema(close, MA3)
    matype3 = input(1, minval=1, maxval=5)
    avgval3 = matype3==1 ? moving_average3 : na
    color3 = avgval3 > avgval3[1] ? color.green : color.red
    plot(moving_average3, color=color3, linewidth=2, transp=0, title=”13 EMA”)
    BB_length1 = input(21, minval=1, title=”Inner BB Length”)
    BB_sdev1 = input(1.0, minval=0.001, maxval=50, title=”Inner BB Width”)
    dev1 = BB_sdev1 * stdev(close, BB_length1)
    upper1 = sma(close, BB_length1) + dev1
    lower1 = sma(close, BB_length1) – dev1
    p1 = plot(upper1, title=”Upper”, color=#E040FB)
    p2 = plot(lower1, title=”Lower”, color=#E040FB)
    BB_length2 = input(21, minval=1, title=”Outer BB Length”)
    BB_sdev2 = input(2.0, minval=0.001, maxval=50, title=”Outer BB Width”)
    dev2 = BB_sdev2 * stdev(close, BB_length2)
    upper2 = sma(close, BB_length2) + dev2
    lower2 = sma(close, BB_length2) – dev2
    p3 = plot(upper2, title=”Upper”, color=#2196F3)
    p4 = plot(lower2, title=”Lower”, color=#2196F3)
    BB_length3 = input(21, minval=1, title=”Middle BB Length”)
    BB_sdev3 = input(0.1, minval=0.001, maxval=50, title=”Middle BB Width”)
    dev3 = BB_sdev3 * stdev(close, BB_length3)
    upper3 = sma(close, BB_length3) + dev3
    lower3 = sma(close, BB_length3) – dev3
    p5 = plot(upper3, title=”Upper”, color=#363A45)
    p6 = plot(lower3, title=”Lower”, color=#363A45)
    start = input(title=”Start”, type=input.float, step=0.001, defval=0.02)
    increment = input(title=”Increment”, type=input.float, step=0.001, defval=0.02)
    maximum = input(title=”Maximum”, type=input.float, step=0.01, defval=0.2)
    width = input(title=”Point Width”, type=input.integer, minval=1, defval=2)
    highlightStartPoints = input(title=”Highlight Start Points ?”, type=input.bool, defval=true)
    showLabels = input(title=”Show Buy/Sell Labels ?”, type=input.bool, defval=true)
    highlightState = input(title=”Highlight State ?”, type=input.bool, defval=true)
    psar = sar(start, increment, maximum)
    dir = psar < close ? 1 : -1
    psarColor = dir == 1 ? #787B86 : #787B86
    psarPlot = plot(psar, title=”PSAR”, style=plot.style_circles, linewidth=1, color=psarColor, transp=0)
    psar_long = high[1] < psar[2] and high >= psar[1]
    psar_short = low[1] > psar[2] and low <= psar[1]
    // Alerts
    alertcondition(psar_long, “PSAR Long”, “PSAR Long”)
    alertcondition(psar_short, “PSAR Short”, “PSAR Short”)

Viewing 1 post (of 1 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login