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)