3 Down, 3 Up on Nasdaq
- Algomatic Trading
- Apr 28, 2024
- 2 min read
Updated: Aug 6, 2024
A simple mean-reversion strategy for Nasdaq 100
The Idea
Nasdaq rarely goes down too many days in a row before bouncing back for a few days. And as the song goes: 3 is the magic number. To increase our chances of the downward momentum being exhausted, we add an entry condition that requires a bar with a big body. This strategy is tested with CFDs but should work just as well on any Nasdaq-100 futures.

Setup for Backtest
Market: US Tech 100 (Nasdaq 100)
Contract: 1 € per point
Broker: IG
Testing environment: ProRealtime 12
Timeframe: Daily
Time zone: CET
No fees and commissions are included.
Result
Total gain: 15 508.0 €
Average gain: 54.8€
Total trades: 283
Winners: 212
Losers: 71
Breakeven: 0
Max drawdown: –1 528.2 €
Risk/reward ratio: 1.2
Total time in the market: 30 %
Average time in the market: 10 days, 6 hours
CAGR (10 000 € in starting capital): 2.71 %

Entry Conditions
Three bearish days in a row: close < open
At least one of the days must have a body bigger than 70% of the size of its range
Exit Conditions
Three bullish days in a row: close > open
Code
ProRealTime
//-------------------------------------------------------------------------
// Concept: Mean-reversion
// Market: US Tech 100 / Nasdaq
// Direction: Long only
// Timeframe: Daily
// Timezone: CET
// Versions: v.1 | By: Algomatictrading.com | 2024-04-26 | OOS since: 2020-01-01
//-------------------------------------------------------------------------
defparam preloadbars = 500
defparam cumulateorders = false
// POSITION MANAGEMENT
//-------------------------------------------------------------------------
once positionsize = 1
// INDICATORS
//-------------------------------------------------------------------------
// Indicators
bodyratio = abs(close-open)/(high-low)
// TRADING CONDITIONS
//-------------------------------------------------------------------------
// Long - Enter
// ------------------
cl = summation[3](close<open)=3
cl = cl and highest[3](bodyratio) >= 0.7
// Long - Exit
// ------------------
clx = summation[3](close>open)=3
// TRADING ACTION
//-------------------------------------------------------------------------
// Enter
// ------------------
if cl then
buy positionsize contract at market
endif
// Exit
// ------------------
if longonmarket and clx then
sell at market
endif
FAQ
Q: Am I free to use this strategy however I want?
A: Sure! But we're happy if you refer to our website and keep the creator's name in the code.
Q: I'm using another platform, can you write the code in another language?
A: No, sorry. We might add code in more languages later to the website, but until then, we recommend you try ChatGPT or something similar to help you rewrite it.
Q: Why does my backtest look different when I run the code?
A: The strategy might give different backtest results for several reasons, like added spread or fees, the wrong time-zone settings, or that you're using another type of contract.
Q: Will I make money if I run this strategy live?
A: We don't know. We're not financial advisors, we're just traders sharing our ideas.