Skip to main content

SMAOffset Strategy: Buy at Discount, Sell at Premium

Nickname: MA Offset King
Specialty: Mean Reversion Expert
Timeframe: 5 minutes


I. What Is This Strategy?​

Simply put, SMAOffset is:

  • Wait for price to drop below the MA by a certain percentage, buy
  • Wait for price to rise above the MA by a certain percentage, sell
  • Simple as can be!

Like shopping at a farmers market 🥕: Veggies normally 5 bucks a pound, today on sale for 4.8 (below average), buy! Tomorrow price goes to 5.1 (above average), sell!


II. Core Configuration: Simply Put, "One MA, Two Lines"​

Take Profit Rules (ROI Table)​

100% profit to exit

Translation: ROI is basically decoration, the strategy exits through sell signals and trailing stop.

Stop Loss Rules​

Fixed stop loss: -10%
Trailing stop: Activates immediately, locks 99.99% profit

Translation: Accept 10% loss. But as soon as you make a tiny profit, the stop line climbs with the price, locking almost all profit. This is an extremely conservative design!


III. 1 Buy Condition: Simple Enough to Make You Suspicious​

This strategy has only one buy condition, literally one:

🎯 Only Buy: MA Discount Buy​

Core Logic: Price is 4.2% below MA, buy!

Plain English:

"This thing normally hangs around the MA, now it's dropped 4.2% below, it's cheap! Buy some and wait for it to bounce back!"

Detailed Script:

Price < MA × 0.958  →  Buy!
Has volume → Confirm

Tunable Parameters:

ParameterDefaultFunction
base_nb_candles_buy30MA period (30 candles)
low_offset0.958Discount ratio (4.2% off)
buy_triggerSMAMA type (can use EMA)

Example:

  • MA price is 100 bucks
  • Discount line = 100 × 0.958 = 95.8 bucks
  • Current price drops to 95.5 → Trigger buy!

IV. 1 Sell Condition: Simple Enough to Make You Suspicious x2​

Sell also has only one condition:

🎯 Only Sell: MA Premium Sell​

Core Logic: Price is 1.2% above MA, sell!

Plain English:

"This thing normally hangs around the MA, now it's risen 1.2% above, it's expensive! Sell and wait for it to drop back!"

Detailed Script:

Price > MA × 1.012  →  Sell!
Has volume → Confirm
In profit state → Only then sell

Tunable Parameters:

ParameterDefaultFunction
base_nb_candles_sell30MA period (30 candles)
high_offset1.012Premium ratio (1.2% markup)
sell_triggerEMAMA type (default more sensitive than buy)

Example:

  • MA price is 100 bucks
  • Premium line = 100 × 1.012 = 101.2 bucks
  • Current price rises to 101.5 → Trigger sell!

V. Protection Mechanism: Two Life Savers​

This strategy may be simple, but its protection mechanism is no joke:

Protection TypeFunctionPlain English
Fixed Stop Loss-10%"Lost too much, I give up"
Trailing StopLocks 99.99% profit"Made money? Lock it, leave nothing behind"
Profit-Only SellOnly sell when profitable"Don't sell at a loss, wait for bounce"

Roast: Trailing stop locking 99.99% profit, this is the ultimate version of "run at any profit"! 😅


VI. This Strategy's "Personality Traits"​

✅ Pros (Praise Time)​

  1. Simple Logic: One MA with two offsets, even elementary students can understand
  2. Fast Calculation: Only calculates MA, old computers can run it
  3. Flexible Parameters: Buy/sell parameters independent, can optimize separately
  4. Good Protection: Aggressive trailing stop, won't lose profits easily

⚠️ Cons (Roast Time)​

  1. Too Simple: No trend judgment, may trade against the trend 🤣
  2. Only Good in Ranging Markets: Trending markets will slap you
  3. Trailing Stop Too Aggressive: Locks profit as soon as you have any, might miss gains
  4. No Volume or Momentum Filter: Only price judgment

VII. Applicable Scenarios: When to Use It?​

Market EnvironmentRecommended ActionReason
Ranging Market✅ Go for it!Price oscillates around MA, perfect match
Uptrend⚠️ CarefulMay keep waiting for pullback that never comes
Downtrend❌ Don't useMay catch falling knives halfway down
High Volatility Coins✅ WorksUse EMA, faster response

VIII. Summary: How's This Strategy Really?​

One-Line Review​

"Extremely simple mean reversion strategy: buy at discount, sell at premium, shear wool in ranging markets"

Who Should Use It?​

  • ✅ Beginners (simple logic, easy to understand)
  • ✅ Ranging market players (price oscillating back and forth is perfect)
  • ✅ People who like simple strategies
  • ✅ People who want to learn MA offset concepts

Who Should NOT Use It?​

  • ❌ Trend traders (this strategy doesn't chase trends)
  • ❌ High frequency traders (5 minute timeframe too slow)
  • ❌ People pursuing complex strategies
  • ❌ People who only make money in bull markets

My Suggestions​

  1. Ranging coins first: Pick coins with regular price oscillations
  2. Tuning advice: low_offset can be set to 0.93-0.96, wait for bigger discounts
  3. Add trend filter: Can add RSI or MACD for filtering
  4. Watch fees: Frequent trading in ranging markets, fees may eat profits

IX. What Markets Can This Strategy Make Money In?​

9.1 Core Logic: Mean Reversion​

SMAOffset is a classic "mean reversion" strategy.

Its Money-Making Philosophy: "Price eventually returns to the MA, buy when cheap, sell when expensive"

  • Assumption: Price oscillates around MA
  • Buy Timing: Price is below MA by certain percentage
  • Sell Timing: Price is above MA by certain percentage

9.2 Performance in Different Markets (Plain English Version)​

Market TypePerformance RatingPlain English Explanation
📈 Uptrend⭐⭐☆☆☆Price keeps going up, never get the pullback or pullback is shallow
🔄 Ranging Market⭐⭐⭐⭐⭐Price swings back and forth, MA strategy perfect
📉 Downtrend⭐⭐☆☆☆Price keeps dropping, catching falling knives
⚡ High Volatility⭐⭐⭐☆☆Trailing stop helps, but might exit too early

One-Line Summary: Ranging markets are its home turf, trending markets are its nemesis!


X. Want to Run This Strategy? Check These Configs First​

10.1 Trading Pair Configuration​

Config ItemSuggested ValueRoast
Pair selectionRanging coinsDon't pick coins that only go up
Timeframe5mDefault is fine
Buy offset0.93-0.97Depends how big a discount you want

10.2 Key Config File Settings​

# Buy parameters (default values)
base_nb_candles_buy: 30 # MA period
low_offset: 0.958 # Discount ratio (4.2% off)
buy_trigger: SMA # Use simple MA

# Sell parameters (default values)
base_nb_candles_sell: 30 # MA period
high_offset: 1.012 # Premium ratio (1.2% markup)
sell_trigger: EMA # Use exponential MA, more sensitive

10.3 Hardware Requirements (Really Low!)​

Trading PairsMinimum MemoryRecommended MemoryExperience
1-50 pairs1GB2GBSmooth
50-200 pairs2GB4GBOkay

Roast: This strategy has extremely low computation, even a Raspberry Pi can run it! 😄

10.4 Backtesting vs Live Trading​

This strategy's backtesting and live trading differences may mainly be in:

  • Fees: Frequent trading in ranging markets, fees are real money
  • Slippage: Actual fill price may differ from expected
  • Extreme Markets: MA fails in sudden spikes and crashes

Recommended Process:

  1. Add fee settings when backtesting
  2. Paper trade at least 1 week
  3. Pick ranging coins for live trading
  4. Monitor fee ratio

Don't go all in right away, test the waters first!


XI. Easter Egg: The Strategy Author's "Little Thoughts"​

Looking carefully at the code, you'll find some interesting things:

  1. Buy/Sell MA Can Be Different:

    "Buy uses SMA, sell uses EMA - buying more stable, selling more sensitive"

  2. Trailing Stop Locks 99.99%:

    "How afraid of losing profit is this? Locks any gain!"

  3. ROI Set to 100%:

    "Basically giving up on ROI, relying entirely on sell signals"

  4. Independent Parameter Design:

    "Buy/sell parameters separate, tune however you want"


XII. The Final Word​

One-Line Review​

"Buy MA discounts, sell at premium - ranging market wool-shearing tool"

Who Should Use It?​

  • ✅ Beginners (simple logic)
  • ✅ Ranging market players (core users)
  • ✅ People who like simple strategies
  • ✅ People wanting to learn MA offsets

Who Should NOT Use It?​

  • ❌ Trend traders
  • ❌ People pursuing complex strategies
  • ❌ People who only make money in bull markets
  • ❌ High frequency traders

Manual Trading Advice​

If you're a manual trader, this strategy's core idea is very practical:

  1. Find an MA (like 30 period)
  2. Wait for price to drop 3-5% below MA before buying
  3. Wait for price to rise 1-3% above MA before selling
  4. Works best in ranging markets, careful in trending markets

XIII. ⚠️ Risk Emphasis Again (Must Read This)​

Backtesting Is Beautiful, Live Trading Needs Caution​

SMAOffset may perform well in ranging market backtesting - but note:

Mean reversion assumes price will revert, but in strong trends this assumption doesn't exist!

Simply put: If price keeps going up or down, this strategy is useless

Strategy's Fatal Weakness​

In live trading, pay special attention to:

  • Trend Risk: In uptrends, waiting for pullbacks that never come; in downtrends, catching falling knives
  • Fee Risk: Frequent trading in ranging markets, fees may eat most profits
  • Premature Exit: Trailing stop too aggressive, might exit just after making a little profit

My Advice (Honest Words)​

1. Only use this strategy in ranging markets
2. Identify trends: If price is consistently above or below MA, pause the strategy
3. Set minimum profit threshold, avoid over-trading
4. Watch fees, calculate if it's worth it

Remember: The simpler the strategy, the narrower its applicable scope. Shear wool in ranging markets, but don't use it in trending markets!


Final Reminder: MA strategies look simple, but to make money you need to pick the right market environment. Ranging coin + ranging market = stable returns; Trending coin + trending market = accept your fate! 🙏