🧠 Trading Logic
This ProRealCode strategy is a simple, always-flat-then-in-long approach that looks for opportunities to buy when price pulls back toward volatility bands but remains in a broader bullish context. It enters a long position only when there is no existing long trade (“NOT LONGONMARKET”). The entry trigger combines two elements: price must dip below the upper Bollinger Band calculated with 21 periods on the close (LOW < BollingerUp[21](close)), and the close must be above a smoothed average of price (CLOSE > AVERAGE[35, 8](close)). In plain terms, it wants to see a small retracement in an uptrend: the market is generally trading above its recent mean, but the current bar’s low has pulled back enough to touch or cross below the upper volatility boundary.
Once in a trade, the strategy uses volatility-adjusted exits based on the Average True Range (ATR). The stop loss is set at 2.4 times the 21-period ATR, giving the position room to breathe during normal fluctuations, while the profit target is placed at 5.4 times the 13-period ATR, aiming for a reward notably larger than the risk. Orders are not accumulated (cumulateorders=false), so it runs a one-position-at-a-time model that should be easier to follow and manage. From the code, this system appears best suited to trending or steadily rising markets where pullbacks are relatively shallow and volatility is moderate; in choppy or sideways conditions, the same logic may lead to more whipsaws as the price oscillates around the moving average and Bollinger Band levels.
📊 Performance Metrics
Metric Value Metric Value Score (SQN)1.36Sharpe Ratio0.79Profit Factor1.23Max Drawdown4.20%Ulcer Index0.075Stability (R²)0.880Trades120PnL ($)2,036Time in Market56.80%MC Score76.0 📈 Backtest Context
InstrumentGold Apr 26 (GC=F)Timeframe1d Period2001-06-19 → 2026-03-03Seed748948382 📉 Equity Curve
⚠️ Community-generated strategy — please read before trading
This strategy was automatically generated by a community member using ProRealQuant, a free tool for automated strategy generation on ProRealTime. It is shared purely for educational and discussion purposes. Past backtest results do not guarantee future performance. Always conduct your own analysis, apply sound risk management, and never trade with capital you cannot afford to lose.
💻 ProBuilder Code
// Generated ProBuilder Strategy
// Auto-generated from ProRealQuant
DEFPARAM cumulateorders=false
DEFPARAM preloadbars = 200
// Entry Condition (LONG)
IF NOT LONGONMARKET AND (LOW < BollingerUp[21](close) AND CLOSE > AVERAGE[35, 8](close)) THEN
BUY AT MARKET
// Stop Loss Exit
SET STOP LOSS (2.4 * AVERAGETRUERANGE[21])
// Take Profit Exit
SET TARGET PROFIT (5.4 * AVERAGETRUERANGE[13])
ENDIF
💬 Join the discussion! Feel free to share your own backtest results on different instruments or timeframes, suggest improvements, propose forks or parameter variations — the community learns best together.
🔧 Generated with ProRealQuant — a free community tool for automated strategy generation and backtesting on ProRealTime. Try it yourself!