• Onchain Edge
  • Posts
  • A BTC Moving Average Investing Strategy That Netted $32k (for people who don't want to look at charts all day)

A BTC Moving Average Investing Strategy That Netted $32k (for people who don't want to look at charts all day)

A simple guide on how to install the strategy and setup alerts so you don't miss the next trade

Hey there!

Let's discuss Moving Averages and why they can help you get better entry into cryptocurrency assets than the average investor.

Some people make fun of technical analysis, saying it's just lines on a chart. However, did you know that assets like BTC tend to rebound off these lines more often than not?

Today, we'll uncover why these Moving Averages are more than just chart decorations – they're a key to profitable trading strategies.

I will share a back-tested moving average strategy that is 54% profitable with BTC on the 3-day timeframe and 55% on the weekly timeframe.

Enjoy

Kierin | Onchain Edge

A simple explanation of what a Moving Average is

Think of a moving average as a smooth path that follows your steps in a game.

Each day, you take some steps and the path smooths out these steps to show where you've been walking lately.

The path changes and moves each day as you take more steps, showing you the average direction of where you're going.

It's like having a trail that follows you, always keeping up with your recent steps!

The "steps" or footprints represent individual price points, similar to how each candle in a candlestick chart represents the price range in a timeframe.

Here are some of the most popular moving average combinations you will find:

  • 13-day and 48.5-day EMAs:

  • Best for generating high returns over short periods​​.

  • SMA 50 and SMA 200 (Golden/Death Cross):

  • Popular for long-term trend analysis.

  • EMA 9 and EMA 21:

  • Preferred by short-term traders for quicker signals.

  • HMA50 (Hull Moving Average):

  • Highest win rate (27%) in backtesting over multiple trades​​.

  • SMA20 and EMA20:

  • Both showed a 23% win rate in extensive backtesting​.

Just search for triple moving average on tradingview and input the variables above to try them out.

A 54% Profitable MA strategy for Bitcoin on TradingView.

  1. Open TradingView and pick your chart.

  2. Hit the "Indicators" button.

  3. Search for "Onchain Edge 3 SMA Cross" (you can also click on the link and go to tradingview and add it as a favourite)

  4. Customize the settings and back-testing information.

Edit: I’m fixing some indicator publishing issues on tradingview so the indicator is currently not available.

You can use this code to use the indicator in the meantime:

//@version=4
strategy("Blockchain Trend SMA Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)

// Configuration Parameters
priceSource = input(close, title="Price Source")
includeIncompleteBars = input(true, title="Consider Incomplete Bars")
maForecastMethod = input(defval="flat", options=["flat", "linreg"], title="Moving Average Prediction Method")
linearRegressionLength = input(3, title="Linear Regression Length")
fastMALength = input(7, title="Fast Moving Average Length")
mediumMALength = input(30, title="Medium Moving Average Length")
slowMALength = input(50, title="Slow Moving Average Length")
tradingCapital = input(10000, title="Trading Capital")
tradeRisk = input(1, title="Trade Risk (%)")

// Calculation of Moving Averages
calculateMA(source, period) => sma(source, period)
predictMA(source, forecastLength, regressionLength) => 
    maForecastMethod == "flat" ? source : linreg(source, regressionLength, forecastLength)

offset = includeIncompleteBars ? 0 : 1
actualSource = priceSource[offset]

fastMA = calculateMA(actualSource, fastMALength)
mediumMA = calculateMA(actualSource, mediumMALength)
slowMA = calculateMA(actualSource, slowMALength)

// Trading Logic
enterLong = crossover(fastMA, mediumMA)
exitLong = crossunder(fastMA, mediumMA)

// Risk and Position Sizing
riskCapital = tradingCapital * tradeRisk / 100
lossThreshold = atr(14) * 2
tradeSize = riskCapital / lossThreshold

if (enterLong)
    strategy.entry("Enter Long", strategy.long, qty=tradeSize)

if (exitLong)
    strategy.close("Enter Long")

// Display Moving Averages
plot(fastMA, color=color.blue, linewidth=2, title="Fast Moving Average")
plot(mediumMA, color=color.purple, linewidth=2, title="Medium Moving Average")
plot(slowMA, color=color.red, linewidth=2, title="Slow Moving Average")

Here's how it looks when it's on your chart:

Here's what the profitability of the OE 3 SMA Cross

Adding an alert so you don't miss the next buy opportunity

To set up an alert, right-click on the alert arrow. In this case, it is long.

Then click on "Add alert on Onchain Edge SMA Cross"

If the last cross was an open long, then the next alert will be a close long.

A popup will appear, and you can customize the Alert name.

For beginners, installing TradingView on your phone is recommended to receive alerts when away from your computer. I normally never set alerts for the close long, only open long, as I only buy spots and never do leverage.

Trading Strategy: Buy Spot When A long Cross Happens

  • Entry Signal: The strategy generates a 'Buy' signal when the Short MA (fast) crosses above the Mid MA, indicating a potential upward trend.

On the weekly BTCUSD chart, a buy signal was triggered at approximately $23k at the beginning of February, which would have resulted in +90% profit with a buy-and-hold strategy at the current prices.

The second opportunity to enter the market was at the second alert at $31k, resulting in a +33% profit at current prices.

You can remain on the safe side by closing your spot position when the close entry signal triggers but you might risk buying back less btc at a higher price.

If you intend to invest for the long term and prefer using larger timeframes, it is recommended to consider Dollar Cost Averaging (DCA) after a long signal is triggered.

This moving average strategy is probably the easiest one to follow for long-term investors. The good thing with this strategy is that it's even more profitable on higher timeframes than on lower timeframes. That means you don't need to worry about short-term market movements.

Conclusion

I would appreciate your feedback on this newsletter. Please share any suggestions you have for future content to improve your experience.

I’ll catch up with you in the next one.

Kierin | Onchain Edge