strategy · own pane · open source
Aroon Trend Strategy
Running…
Loading chart…
About
Aroon Up/Down trend strategy: long when Aroon Up crosses above 70 and Aroon Down is below 30 (fresh bullish extreme), exit when the relationship reverses.
- Both lines below 30 = consolidation; expect a breakout.
- Combine with volume confirmation for the strongest setups.
- 25-period is the canonical Aroon lookback.
Source code
//@version=5
strategy("Aroon Trend Strategy", overlay=false, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.05)
len = input.int(25, "Length", minval=5, maxval=100, step=1)
stopPct = input.float(2, "Stop Loss %", minval=0.5, maxval=10, step=0.1)
tpPct = input.float(6, "Take Profit %", minval=0, maxval=20, step=0.1)
aroonUp = 100 * (len - ta.highestbars(high, len)) / len
aroonDn = 100 * (len - ta.lowestbars(low, len)) / len
longSignal = strategy.position_size == 0 and ta.crossover(aroonUp, 70) and aroonDn < 30
exitSignal = strategy.position_size > 0 and ta.crossunder(aroonUp, 50)
if longSignal
strategy.entry("Long", strategy.long)
if strategy.position_size > 0
strategy.exit("Risk", stop=stopPct > 0 ? strategy.position_avg_price * (1 - stopPct / 100) : na, limit=tpPct > 0 ? strategy.position_avg_price * (1 + tpPct / 100) : na)
if exitSignal
strategy.close("Long", comment="Aroon fade")
hline(70, "Strong", color=color.gray, linestyle=hline.style_dashed)
hline(30, "Weak", color=color.gray, linestyle=hline.style_dashed)
p_Aroon_Up = plot(aroonUp, "Aroon Up", color=color.green, linewidth=2)
p_Aroon_Down = plot(aroonDn, "Aroon Down", color=color.red, linewidth=2)
plotshape(longSignal, "Long", style=shape.triangleup, location=location.belowbar, color=color.green, text="L")
plotshape(exitSignal, "Exit", style=shape.triangledown, location=location.abovebar, color=color.red, text="X")
alertcondition(longSignal, "Aroon long entry", "Aroon Up crossed 70 with Down below 30")
alertcondition(exitSignal, "Aroon exit", "Aroon Up crossed below 50")
No comments yet.
Sign in to comment.