ReinforcedAverageStrategy: The "Steady as an Old Dog" in Trends
Nickname: MA Watchman
Job: Veteran trend follower
Timeframe: 4 hours (4h)
I. What is This Strategy?
Simply put, ReinforcedAverageStrategy is:
- Buy and sell based on MA crossover signals
- Use larger timeframe trend for secondary confirmation
- Trailing stop to protect profits
Like an old hunter waiting on a mountain - won't shoot until the prey is in optimal range AND the wind direction is right 🎯
II. Core Configuration: "Wide Stop Loss, Let Profits Run"
Take Profit Rules (ROI Table)
0% → 50% profit target
Translation: ROI set to 50%, but this is just a reference, practically relies on trailing stop and sell signals to exit. Means "I'm not in a hurry, whatever I make is what I make."
Stop Loss Rules
Fixed stop loss: -20%
Trailing stop: Activation threshold 2%, trigger on 1% pullback
Translation:
- Fixed stop 20%, gives trend enough breathing room
- Trailing stop activates after 2% gain, then if price pulls back 1% from the high, exit immediately
This configuration says: "I'm not afraid of volatility, but you better protect the money I've made!"
III. 1 Buy Condition: Simple and Direct
This strategy's buy condition is particularly simple, just one condition:
🎯 Buy Signal: MA Golden Cross + Trend Confirmation
Core Logic: 8-period EMA crosses above 21-period EMA, while price is above a larger timeframe MA.
Plain English:
"Short-term MA crosses above medium-term MA going up, big trend is also up, let's enter!"
Code Breakdown:
# Condition breakdown
qtpylib.crossed_above(dataframe['maShort'], dataframe['maMedium']) # EMA(8) crosses above EMA(21)
(dataframe['close'] > dataframe['resample_sma']) # Price above 48-hour SMA(50)
(dataframe['volume'] > 0) # Has volume
Translation:
- 8-hour EMA crosses above 21-hour EMA going up = "Short-term momentum is rising"
- Price above 48-hour SMA(50) = "Big trend is up, not a fake breakout"
- Has volume = "Market has interest"
Like dating: Short-term impression is good (MA crossover), family background also verified (resampled trend confirmation), finally confirmed they're alive (volume > 0), then decide to meet 💑
IV. Protection Mechanisms: Trailing Stop as "Fuse"
Strategy configures trailing stop, like installing a "safety rope" for profits:
| Protection Type | Function | Plain English |
|---|---|---|
| trailing_stop_positive_offset | 2% activation threshold | "I won't watch you until you're up 2%" |
| trailing_stop_positive | 1% stop distance | "If you drop 1% from the high, I'm out" |
Workflow:
- After buying, price rises 2% → Trailing stop activates
- Price continues to 10% → Stop line also rises to 9%
- Price falls from 10% to 9% → Triggers sell, locks in 9% profit
Plain English:
"After making money, I'm like a clingy spirit, wherever price goes I follow, but if you dare run back 1%, I'm jumping off immediately!"
V. Sell Logic: Reverse Cross, Run!
5.1 Basic Sell Signal
Trigger Condition: EMA(21) crosses above EMA(8)
Plain English:
"Short-term MA turns downward and crosses below medium-term MA, trend reversed, retreat!"
qtpylib.crossed_above(dataframe['maMedium'], dataframe['maShort'])
Translation: MA death cross, trend going from bullish to bearish.
5.2 Sell Only When Profitable
Strategy has a configuration sell_profit_only = True, meaning:
"When losing, I don't listen to sell signals, if losing I just hold on and wait for bounce or stop loss."
This configuration is quite human - when losing don't use MA signals, avoid emotional cutting 😅
VI. This Strategy's "Personality Traits"
✅ Pros (Praise Section)
- Simple and Clear Logic: MA crossover is the most classic trading signal, no PhD needed to understand
- Trend Filtering Done Right: Resampling technology ensures not trading against major trend
- Trailing Stop Protection: Lets profits run without giving back earned money
- Large Cycle Stability: 4-hour level reduces noise, won't frequently enter and exit
⚠️ Cons (Complaint Section)
- Signal Lag: MAs are lagging indicators, by the time they cross, the move is already underway
- Tortured in Oscillating Markets: During sideways, MAs keep crossing back and forth, repeatedly slapping your face
- Fixed Parameters: Only one set of EMA(8,21), doesn't self-adapt to market
- Stop Loss Too Wide: 20% stop loss is quite thrilling for the timid 💀
VII. Suitable Scenarios: When to Use It?
| Market Environment | Recommended Action | Reason |
|---|---|---|
| 📈 Clear uptrend | ✅ Recommended | MA golden cross captures trends accurately |
| 📉 Clear downtrend | ✅ Watch or short | Strategy will wait in cash, won't trade against trend |
| 🔄 Sideways oscillation | ⚠️ Use cautiously | Will have frequent false breakouts, repeated stop losses |
| ⚡ High volatility no direction | ❌ Not recommended | MA signals distorted, frequent stop triggers |
VIII. Summary: How's This Strategy Really?
One-Sentence Review
"Classic among classics, simple but effective, suitable for old-school players in trending markets."
Who Should Use It?
- ✅ Quant beginners wanting to learn MA crossovers
- ✅ Steady players who like trend following
- ✅ Bold folks who can accept 20% drawdown
- ✅ Patient traders willing to wait for signals
Who Shouldn't Use It?
- ❌ Perfectionists chasing high win rates
- ❌ Speculators only wanting to make money in sideways markets
- ❌ Impatient folks who can't stand signal lag
- ❌ Small capital traders who can't withstand 20% drawdown
My Recommendations
- Enable when trend is clear: See if big direction is up or down, go with it
- Turn off during oscillation: Using this strategy in sideways is just donating fees to the exchange
- Combine with other indicators: Can add ADX to judge trend strength
- Money management: Don't go all-in, this strategy's 20% stop loss is no joke
IX. What Markets Can This Strategy Make Money In?
9.1 Core Logic: Using MAs to Find Trend Starts
ReinforcedAverageStrategy is a classic trend following strategy. Not much code, but solid logic - use MA crossovers to find entry points, use resampling to confirm trend, use trailing stop to protect profits.
Its Money-Making Philosophy:
- Don't predict: Wait for trend to emerge on its own
- Don't be greedy: Trailing stop automatically exits
- Don't fight trend: If major trend is down, don't buy
9.2 Performance in Different Markets (Plain English Version)
| Market Type | Performance Rating | Plain English Explanation |
|---|---|---|
| 📈 One-way uptrend | ⭐⭐⭐⭐⭐ | MA golden cross perfectly captures, trailing stop eats most of the profit |
| 📉 One-way downtrend | ⭐⭐⭐⭐☆ | Won't buy against trend, sits in cash and survives |
| 🔄 Sideways oscillation | ⭐⭐☆☆☆ | MAs keep crossing, repeated stop losses eating fees |
| ⚡ High volatility no direction | ⭐☆☆☆☆ | Signals completely fail, getting slapped back and forth |
One-Sentence Summary: It's a god when trend comes, it's a ghost when oscillation comes.
X. Want to Run This Strategy? Check These Configurations First
10.1 Trading Pair Configuration
| Configuration Item | Recommended Value | Comment |
|---|---|---|
| Timeframe | 4h | Default, don't go smaller, smaller means more noise |
| Resampling factor | 12 | Keep default, approximately 2-day cycle |
| Number of pairs | 5-20 | Too many to watch, too few not enough diversification |
10.2 Hardware Requirements (Important!)
This strategy has minimal computation, very low hardware requirements:
| Trading Pairs | Minimum Memory | Recommended Memory | Experience |
|---|---|---|---|
| 1-10 pairs | 2GB | 4GB | Smooth |
| 10-50 pairs | 4GB | 8GB | No problem |
Warning: Almost no need to worry about hardware, even a Raspberry Pi can run it 😂
10.3 Backtest vs Live Trading
MA strategies have relatively small gap between backtest and live trading, but note:
- Slippage: Price may have already moved when crossover signal confirms
- Candle close: Must wait for 4-hour candle close to confirm signal
Recommended Process:
- Backtest to see general performance
- Run simulation for 1-2 weeks
- Small position live testing
- Confirm no issues before scaling up
Don't go all-in on day one, no matter how good the strategy is, it needs to be broken in!
XI. Bonus: The Strategy Author's "Little Secrets"
Looking carefully at the code, you'll find some interesting things:
-
ROI set to 50%: Author has great mindset, not in a rush
"I'm not in a hurry to sell, profits will run on their own"
-
Bollinger Bands just for display: Code calculates Bollinger Bands, but buy/sell logic doesn't use them at all
"I just drew them for looks, don't overthink it"
-
Resampling technology is clever: Uses 48-hour cycle to confirm trend, avoids false breakouts
"Confirm big direction before acting, steady!"
XII. The Very Last Thing
One-Sentence Review
"Classic MA crossover + trend filter combo, suitable for players wanting steady profits in trending markets."
Who Should Use It?
- ✅ Quantitative learning beginners
- ✅ Trend following enthusiasts
- ✅ Patient investors who can accept drawdowns
- ✅ Minimalists who like simple strategies
Who Shouldn't Use It?
- ❌ People chasing high win rates
- ❌ People only doing sideways markets
- ❌ Impatient traders
- ❌ People with too little capital
Manual Trader Recommendations
This strategy's logic is simple, can be completely executed manually:
- Open trading software, add EMA(8) and EMA(21)
- Wait for golden cross confirmation
- Switch to daily chart to see if major trend is up
- Set trailing stop
- Go about your business
XIII. ⚠️ Risk Re-emphasis (Must Read This Section)
Backtests Are Beautiful, Live Trading Needs Caution
ReinforcedAverageStrategy's historical backtest in trending markets often performs very impressively - but there's a trap:
MAs are lagging indicators, by the time it confirms a signal, the move may already be half or mostly done.
Simply put: "By the time MAs tell you a trend is here, smart money already got in."
Hidden Risks in Oscillating Markets
MA strategies in oscillating markets are a nightmare:
- Repeated crossovers: Up and down crossings non-stop, all signals are fake
- Accumulated stop losses: Getting stopped out 1-2% each time, adds up significantly
- Confidence collapse: After 10 consecutive losses you might question life itself
My Recommendations (Sincere Advice)
1. First determine if market is trending, if not don't use
2. Use ADX or other trend strength indicators to filter signals
3. Turn off strategy during oscillation, protect your capital
4. Never go all-in, enter in batches
Remember: MA strategies are a trend's best friend, and an oscillation's ATM - the kind that feeds money to the exchange.
Final Reminder: No matter how good the strategy is, when the market teaches you a lesson, it won't give you a heads up. Test with small positions, staying alive is most important! 🙏