Gold trading strategy
A gold trading strategy is a set of rules for when to buy gold, sell it or stay out, such as following its trend with moving averages, and it should be backtested on past prices before you trade it. Keel is a strategy builder and backtester for Hyperliquid perpetuals, and backtests on Hyperliquid's gold perp are coming soon. Today you can build and test the same trend rules on Hyperliquid's crypto perps.
Gold backtesting
Gold backtesting is coming to Keel. It is not in the product yet.
In Keel today
- Backtest over the dates you choose, with fees, slippage and funding
- Change a setting and re-run; every version and backtest is kept
- Paper trade on live Hyperliquid prices with no money at risk
The strategies gold traders use
Trend following is one of the most common rules-based ways to trade gold. Gold has had long runs in both directions, so a simple rule such as holding it while a faster moving average sits above a slower one catches much of a run and steps aside when it ends. The well-known golden cross is this rule with slow averages.
Breakout strategies buy when gold closes above its recent range and sell when it falls back. Mean reversion does the opposite and fades a stretched move, which suits quiet, range-bound stretches better than strong trends.
Whatever the rule, test it on gold's own history first. A backtest over calm and stressed years shows how deep the losing runs get and how often the rule trades, which matters as much as the total return.
Gold now trades as a perp, around the clock
Hyperliquid lists a gold perpetual that tracks the US dollar spot price of a troy ounce (XAU/USD). It is a HIP-3 market, launched by an independent builder on Hyperliquid's order book. The main gold markets close from Friday evening to Sunday evening, New York time, and the perp keeps trading through the weekend. Funding keeps its price close to spot.
Keel doesn't support HIP-3 markets yet, so you can't backtest the gold perp in Keel today. Support is coming soon. Keel backtests Hyperliquid's crypto perps, and trend rules work the same way there: the strategy below is the moving-average rule gold traders use, run on large crypto perps.
Hyperliquid's crypto perps also include PAX Gold (PAXG), a token Paxos says is backed by one fine troy ounce of gold stored in London vaults. It trades as a regular crypto perp, so it sits inside the markets Keel backtests today. It follows the gold price closely but is not the same market as XAU/USD, so treat a PAXG backtest as a close stand-in, not a gold backtest.
A moving-average trend strategy, in full
The same trend rule gold traders use, run on Hyperliquid's crypto perps. Here are its rules, its blocks and its backtest.
The rules
- Once a day, look at 8 large Hyperliquid perps, starting with BTC and ETH.
- Work out a 20-day and a 50-day moving average of each coin's price.
- Hold a long position while the 20-day average is above the 50-day one, and step aside when it drops below.
- Give each coin the same slice of the account, never more than one times the account in total.
The same rules, as blocks
Each block is one step: load prices, compute the two averages, compare them, size the positions. Fork it, then change the coins or the averages and run the backtest again.
Configuration
Globals(target_timeframe="1d", bar_offset="12h")
Universe(mode="manual", symbols=["BTC", "ETH", "SOL", "BNB", "XRP", "DOGE", "HYPE", "SUI"], market="perp", resolved=["BTC", "ETH", "SOL", "BNB", "XRP", "DOGE", "HYPE", "SUI"], resolved_at="2026-07-06T00:00:00Z")
Execution(rebalance="on_change")
Pipeline([
PriceDataLoader(),
{
"fast": [EWMA(window=20)],
"slow": [EWMA(window=50)],
},
Crossover(fast_key="fast", slow_key="slow"),
AboveThresholdFilter(threshold=0.0),
FixedWeightSizer(weight_per_position=0.125),
LeverageCap(max_leverage=1.0),
], name="ma_crossover_crypto")
The backtest
Hyperliquid, Aug 2024 to Sep 2026, after trading fees, slippage and funding, on the default settings. Change the averages or the coins and see how much the result moves. Past results don't predict future ones.
Test the idea on crypto perps today
Gold backtests aren't in Keel yet. The same trend, breakout and mean reversion rules are, on Hyperliquid's crypto perps.
Describe a strategy in plain words
Tell Keel's AI what to buy or short, when to get out and how big to go. It builds the strategy as blocks you can read and change, then backtests it.
How the AI builder worksReal costs in every run
Every backtest charges trading fees and slippage and applies Hyperliquid's hourly funding to open positions, so a setting that trades a lot pays for it.
How the backtest worksStart from a tested strategy
The strategy library has trend, breakout and mean reversion strategies with full backtests. Fork one into your account and change it.
Browse the strategy libraryPaper trade before real money
Run a strategy on live Hyperliquid prices with no money at risk, and see how it trades before you fund it.
Paper trading on live pricesWatch the gold perp live
See the gold perp's live price, daily change and volume on Hyperliquid, including at weekends when the main gold markets are closed.
Gold on HyperliquidGold backtesting
Gold backtesting is coming to Keel. It is not in the product yet. Sign up free and we'll email you when it ships. Your account works today: build a strategy, backtest it and paper trade it while you wait.
Common questions
What is the best gold trading strategy?
There isn't one that always works. Trend following with moving averages is a common rules-based approach because gold has had long runs, but it loses in choppy markets. Test any rule on gold's own history, including its bad years, before you trade it.
Can I backtest a gold strategy in Keel?
Not yet. Gold on Hyperliquid is a HIP-3 market, and Keel doesn't support HIP-3 markets yet. Support is coming soon, and if you sign up we'll email you when it ships. Today you can backtest the same rules on Hyperliquid's crypto perps.
Can I trade gold on Hyperliquid?
Hyperliquid lists a gold perp that tracks XAU/USD as a HIP-3 market. It trades 24/7, weekends included, and pays or charges funding. Gold on Hyperliquid shows its live price and volume.
Can I backtest PAXG in Keel?
Yes. PAX Gold trades as a regular crypto perp on Hyperliquid, so Keel can backtest strategies on it today. It tracks the gold price closely but is a token, not XAU/USD itself, so its prices and funding are its own.
How do I backtest a gold strategy?
Write the rules down exactly, run them over several years that include calm and stressed markets, and charge fees, spread and holding costs on every trade. Then check the result on dates you didn't use to choose the settings, and paper trade it before real money.
How realistic are Keel's backtests?
Every backtest charges trading fees and slippage on each trade and applies Hyperliquid's real hourly funding to every open position. It is still a simulation: fills are modelled, and past results don't predict future ones. How Keel works explains how the backtest and the live run use the same compiled strategy.
Start with a backtest
Sign up free and we'll email you when it ships. Your account works today: build a strategy, backtest it and paper trade it while you wait.