Pine Script to PRT code conversion for Multi Time Frame strategy on EURUSD

Forums ProRealTime English forum ProBuilder support Pine Script to PRT code conversion for Multi Time Frame strategy on EURUSD

Viewing 4 posts - 1 through 4 (of 4 total)
  • #215141

    Hi,

    I am new to the forum but have dabbled with PRT for a number of years.

    Please could you provide a code conversion for the strategy below for trading EUR/USD

    It is a multi time frame strategy using the 1 hour and 1 minute candlestick charts

    The code is written in Pine Script

    Thanks and happy trading.

    Tony

    //@version=5
    strategy(“EUR/USD Trading Strategy”, overlay=true)

    // Define indicators and time frames
    supertrendLength = 10
    supertrendMultiplier = 3
    confirmIndicatorLength = 14

    // Calculate Supertrend on 1-hour chart
    [stLine, stTrend] = ta.supertrend(security(syminfo.tickerid, “60”, close), supertrendLength, supertrendMultiplier)

    // Calculate Confirmation Indicator (RSI) on 1-minute chart
    confirmIndicator = ta.rsi(close, confirmIndicatorLength)

    // Define entry conditions
    enterLong = crossover(confirmIndicator, 50) and stTrend == 1
    enterShort = crossunder(confirmIndicator, 50) and stTrend == -1

    // Define exit conditions
    exitLong = crossunder(confirmIndicator, 50) and stTrend == -1
    exitShort = crossover(confirmIndicator, 50) and stTrend == 1

    // Execute trades
    if (enterLong)
    strategy.entry(“Long”, strategy.long)
    if (enterShort)
    strategy.entry(“Short”, strategy.short)

    if (exitLong)
    strategy.close(“Long”)
    if (exitShort)
    strategy.close(“Short”)

    // Set stop loss and take profit
    stopLoss = 0.0025 // Set your desired stop loss value
    takeProfit = 0.005 // Set your desired take profit value

    strategy.exit(“Exit Long”, “Long”, stop=low – stopLoss, limit=high + takeProfit)
    strategy.exit(“Exit Short”, “Short”, stop=high + stopLoss, limit=low – takeProfit)

    #215285
    JS

    Hereby a start of conversion, SL and TP have yet to be determined…

     

    #215289

    Correct version:

     

     

    #215291

    sorry this one is correct,  I guess:

     

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

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