Pine script to ProRealTime

Forums ProRealTime English forum ProRealTime platform support Pine script to ProRealTime

Viewing 15 posts - 1 through 15 (of 15 total)
  • #4952

    Hi,

    Is there an easy way to convert pine script to ProRealTime? Tradingview.com has so many good strategies and indicators which would be fun to work with in ProRealTime.

    Such as:

    https://www.tradingview.com/script/ebcDTcRi-vdr-1min-Open-Close-v1-2-Long-Short-Edition/

    All the best!
    Simon

    #4966

    Hello Simon, I already play a lot with Pinescript conversion to ProRealTime in the past and also recently to assist people.

    Our member Xel, has also made some personal conversion of indicators too.

    The strategy you are pointing is using Heiken Ashi candlesticks, right? I saw a lot of conditional “offset” variables to enter and exit market, they seems to have been optimized and for different specific instruments as well.

    #5002

    Thanks for reply!

    Yes, I saw it uses Heiken Ashi, so maybe it repaints?

    #5010

    If Heiken Ashi candlesticks construction are set to the same timeframe, they don’t repaint. As long as I understand how Pinescript is functioning. Because I saw it were possible to use higher timeframe candles informations. So this strategy would be easily adapted to PRT.

    #5020

    Thanks for reply!

    How can I get the code translated to PRT? Can somebody do it for free?
    I think the spread dose not show on Tradingview, when a strategy is calculated.

    #5021
    xel

    Thaks for the Mention Nicolas, Im not a guru of programming but I’ll try to do my best to help in forums.

    Cheers!

    #5024

    @simon

    If you say “please”, I could be helpful 🙂


    @xel

    “but I’ll try to do my best to help in forums.” = I need more guys like you! 🙂

    #5059

    Please

    #16574

    Hi Nicolas

    Do you know how one could do a MTF MA in pinescripts, but zero lag?

    And how could one do the same with volatility stop and cci?

    Cheers,

    V

    #16577

    I’m sorry, I can’t help you with Pinescript programming.

    #133163
    SMU

    I’m a Pine script expert but new to RealCode. Just this week I joined IG platform that supports RealCode. Can any expert tell the advantage of RealCode over PineScript?

     

    Much apriciated.

    #133489

    Well for on the one side it is even simpler and faster to code, also you have much more data available for back testing. PRT also comes with an optimization engine.

     

    #191067

    Hello, this is a pretty old post. I’d like to convert this stock screener from Pine script to Prorealcode. Can any of you help please?

    //

    study(“Confluence Candles”, overlay=true)

     

    includeSymbol1 = input(true, “Include Symbol 1?”, group = “Symbols”)

    useCurrentChartAsSymbol1 = input(true, “Use current chart’s symbol as Symbol 1”, group = “Symbols”)

    symbol1 = input(“”, “Symbol 1”, group = “Symbols”)

    includeSymbol2 = input(false, “Include Symbol 2?”, group = “Symbols”)

    symbol2 = input(“”, “Symbol 2”, group = “Symbols”)

    includeSymbol3 = input(false, “Include Symbol 3?”, group = “Symbols”)

    symbol3 = input(“”, “Symbol 3”, group = “Symbols”)

    includeSymbol4 = input(false, “Include Symbol 4?”, group = “Symbols”)

    symbol4 = input(“”, “Symbol 4”, group = “Symbols”)

     

    // Kill Switch for if no instruments were selected

    killSwitch =  not includeSymbol1 and not includeSymbol2 and not includeSymbol3 and not includeSymbol4

     

    includeRsi = input(true, “Include RSI”, group = “RSI”)

    rsiLength = input(7, “RSI Length”, group = “RSI”)

    rsiBullThreshold = input(50, “RSI Bull Threshold”, group = “RSI”)

    rsiBearThreshold = input(50, “RSI Bear Threshold”, group = “RSI”)

    includeStoch = input(true, “Include Stochastic”, group = “Stochastic”)

     

    periodK = input(14, title=”%K Length”, minval=1, group = “Stochastic”)

    smoothK = input(1, title=”%K Smoothing”, minval=1, group = “Stochastic”)

    periodD = input(3, title=”%D Smoothing”, minval=1, group = “Stochastic”)

    useStochD = input(false, “Use Stochastic D instead of K”, group = “Stochastic”)

    stochBullThreshold = input(50, “Stochastic Bull Threshold”, group = “Stochastic”)

    stochBearThreshold = input(50, “Stochastic Bear Threshold”, group = “Stochastic”)

     

    includeMacdHist = input(true, “Include MACD Histogram”, group = “MACD”)

    macdFastLength = input(12, “MACD Fast Length”, group = “MACD”)

    macdSlowLength = input(26, “MACD Slow Length”, group = “MACD”)

    macdSignalLength = input(9, “MACD Signal Length”, group = “MACD”)

     

    // Kill Switch for if no indicators are selected

    confluenceKillSwitch = not includeMacdHist and not includeRsi and not includeStoch

     

    stochastic(periodK, smoothK, periodD) =>

    k = sma(stoch(close, high, low, periodK), smoothK)

    d = sma(k, periodD)

    output = useStochD ? d : k

     

    confluence() =>

    [_, _, histLine] = macd(close, macdFastLength, macdSlowLength, macdSignalLength)

    rsiLine = rsi(close, rsiLength)

    stochLine = stochastic(periodK, smoothK, periodD)

    histBull = includeMacdHist ? histLine > 0 : true

    histBear = includeMacdHist ? histLine <= 0 : true

    rsiBull = includeRsi ? rsiLine > rsiBullThreshold : true

    rsiBear = includeRsi ? rsiLine < rsiBearThreshold : true

    stochBull = includeStoch ? stochLine > stochBullThreshold : true

    stochBear = includeStoch ? stochLine < stochBearThreshold : true

    signal = histBull and rsiBull and stochBull and not confluenceKillSwitch ? 1 : histBear and rsiBear and stochBear and not confluenceKillSwitch ? -1 : 0

     

    confluenceSymbol1 = useCurrentChartAsSymbol1 ? confluence() : security(symbol1, “”, confluence())

    confluenceSymbol2 = security(symbol2, “”, confluence())

    confluenceSymbol3 = security(symbol3, “”, confluence())

    confluenceSymbol4 = security(symbol4, “”, confluence())

     

    symbol1BullFilter = includeSymbol1 ? confluenceSymbol1 == 1 : true

    symbol1BearFilter = includeSymbol1 ? confluenceSymbol1 == -1 : true

     

    symbol2BullFilter = includeSymbol2 ? confluenceSymbol2 == 1 : true

    symbol2BearFilter = includeSymbol2 ? confluenceSymbol2 == -1 : true

     

    symbol3BullFilter = includeSymbol3 ? confluenceSymbol3 == 1 : true

    symbol3BearFilter = includeSymbol3 ? confluenceSymbol3 == -1 : true

     

    symbol4BullFilter = includeSymbol4 ? confluenceSymbol4 == 1 : true

    symbol4BearFilter = includeSymbol4 ? confluenceSymbol4 == -1 : true

     

    bullish = symbol1BullFilter and symbol2BullFilter and symbol3BullFilter and symbol4BullFilter and not killSwitch

    bearish = symbol1BearFilter and symbol2BearFilter and symbol3BearFilter and symbol4BearFilter and not killSwitch

     

    barcolor(bullish ? #00FF00 : bearish ? #FF0000 : color.gray)

     

    // Alerts

    greenCandleAlerts = input(true, “Alerts for candle color changing to GREEN”, group=”Alerts”)

    redCandleAlerts = input(true, “Alerts for candle color changing to RED”, group=”Alerts”)

    grayCandleAlerts = input(true, “Alerts for candle color changing to GRAY”, group=”Alerts”)

     

    if (greenCandleAlerts and bullish and not bullish[1])

    alert(“Candle color changed to GREEN”, alert.freq_once_per_bar_close)

     

    if (redCandleAlerts and bearish and not bearish[1])

    alert(“Candle color changed to RED”, alert.freq_once_per_bar_close)

     

    if (grayCandleAlerts and not bullish and not bearish and (bullish[1] or bearish[1]))

    alert(“Candle color changed to GRAY”, alert.freq_once_per_bar_close)

     

    #191072

    Edit: This is not a screener, this is an indicator. Source: https://www.tradingview.com/script/rhE9Itaw-Confluence-Candles/

    Stilll, it would be great to be able to screen stocks with proscreener based on the same logic.

    Default Logic
    Green Candles
    RSI > 50
    Stochastic > 50
    MACD Histogram > 0

    Red Candles
    RSI < 50
    Stochastic < 50
    MACD Histogram < 0

    When multiple symbols are selected, the above needs to be true for all selected symbols.

    #191128

    Not possible to use multiple symboles in the same code for indicators, sorry.

Viewing 15 posts - 1 through 15 (of 15 total)

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