0bps

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.

Author
ChaoZhang
Complexity
Starter · 28 lines
Parameters
1
Backtest bar
1h · intraday
Tested on
BTC/USDT · futures

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:

  1. Calculate current account drawdown percentage and plot it.

  2. When drawdown reaches a threshold (e.g. 5%), market may be oversold so go long.

  3. If next day's close is higher than previous day's, close long for profit.

  4. If no drawdown or threshold not reached, no trades are placed.

  5. After drawdown trade, account is reset to recalculate for next signal.

Advantage Analysis

Advantages of the strategy:

  1. Drawdown longs can profit from market bounces.

  2. Auto trading after reaching drawdown threshold.

  3. Larger size possible for higher returns during drawdown.

  4. Simple and clear logic for easy implementation.

  5. Threshold can be adjusted based on market conditions.

Risk Analysis

There are also some risks:

  1. Inaccurate drawdown signal may cause failed trades.

  2. Market could drop further after drawdown longs.

  3. Position sizing and stops should be set appropriately.

  4. Avoid overtrading from excessive signals.

  5. 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

NameDefaultWhat it controls
v_input_1-5Drawdown, %

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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Drawdown-Entry-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open