Gold for April-22-26

Gold for April-22-26


//@version=5
strategy("XAUUSD Trade Plan", overlay=true)

// Define inputs
rsiOverbought = input(70, "RSI Overbought")
rsiOversold = input(30, "RSI Oversold")
rsiLength = input(14, "RSI Length")

// Calculate RSI
rsiValue = ta.rsi(close, rsiLength)

// Entry Conditions
buyCondition = ta.crossover(rsiValue, rsiOversold) and close > 3223
sellCondition = ta.crossunder(rsiValue, rsiOverbought) or close < 3223

// Execute Orders
strategy.entry("Buy", strategy.long, when=buyCondition)
strategy.entry("Sell", strategy.short, when=sellCondition)

// Plotting
plotshape(buyCondition, "Buy", shape.triangleup, location.belowbar, color=color.green)
plotshape(sellCondition, "Sell", shape.triangledown, location.abovebar, color=color.red)

Read More

Share:

Latest News