Strategy vault / Mean reversion
Drawdown Entry Strategy
This article introduces an entry strategy based on drawdowns. It monitors account drawdowns and selectively goes long when drawdown reaches a threshold, aiming to profit from market bounces.
Overview
This article introduces an entry strategy based on drawdowns. It monitors account drawdowns and selectively goes long when drawdown reaches a threshold, aiming to profit from market bounces.
Strategy Logic
The logic is:
Calculate current account drawdown percentage and plot it.
When drawdown reaches a threshold (e.g. 5%), market may be oversold so go long.
If next day's close is higher than previous day's, close long for profit.
If no drawdown or threshold not reached, no trades are placed.
After drawdown trade, account is reset to recalculate for next signal.
Advantage Analysis
Advantages of the strategy:
Drawdown longs can profit from market bounces.
Auto trading after reaching drawdown threshold.
Larger size possible for higher returns during drawdown.
Simple and clear logic for easy implementation.
Threshold can be adjusted based on market conditions.
Risk Analysis
There are also some risks:
Inaccurate drawdown signal may cause failed trades.
Market could drop further after drawdown longs.
Position sizing and stops should be set appropriately.
Avoid overtrading from excessive signals.
Drawdown threshold should consider account risk tolerance.
Conclusion
This strategy tries to capture bounces after drawdowns. But traders should evaluate timing carefully and manage risks when trading drawdowns.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | -5 | Drawdown, % |
Source Pine Script
/*backtest
start: 2023-08-16 00:00:00
end: 2023-09-15 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2019
//@version=3
strategy(title = "Noro's DD Strategy", shorttitle = "DD str", overlay = false, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0)
signal = input(-5.0, title = "Drawdown, %")
bull = close > close[1] ? 1 : 0
bear = close < close[1] ? 1 : 0
lastbull = 0.0
lastbull := bull ? close : lastbull[1]
dd = ((close / lastbull) - 1) * 100
plot(dd, color = black, transp = 20)
bottom = dd < signal
col = bottom ? lime : na
bgcolor(col, transp = 20)
if bottom
strategy.entry("Long", strategy.long)
if strategy.position_size > 0 and close > open
strategy.entry("Close", strategy.short, 0)Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-16. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Drawdown-Entry-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- 1 2 3 Pattern Quantitative Trading Strategy with EMAs MACD and 4th Candle ExtensionPine Script · Mean reversion · 1h
- 3 10 Oscillator Profile Flagging StrategyPine Script · Mean reversion · 1d
- A Trend Reversal Strategy Based on Moving Averages Price Patterns and VolumePine Script · Mean reversion · 1d
- ATR and EMA based Dynamic Take Profit and Stop Loss Adaptive StrategyPine Script · Mean reversion · 1h
- Adaptive Mean Reversion Trading Strategy Based on Chande Momentum OscillatorPine Script · Mean reversion · 1d
- Adaptive Moving Average Tracking StrategyPine Script · Mean reversion · 1d