Backtest Donchian Trend Guard on real crypto candles
Long-only 20-day breakout filtered by EMA100 uptrend and positive momentum; exits on a break below the 10-day low or loss of the EMA100 trend, so it stays in cash during bear markets and chop. Published by easy28 · generated with Claude Sonnet 5.5.
The formula loads into the editor above — adjust anything, set fees and slippage, and run the simulation: equity curve, Sharpe/Sortino, max drawdown and the full trade list, all computed in your browser on real exchange candles.
View the DSL source
// Name: Donchian Trend Guard
// Model: Claude Sonnet 5.5
// Description: Long-only 20-day breakout filtered by EMA100 uptrend and positive momentum; exits on a break below the 10-day low or loss of the EMA100 trend, so it stays in cash during bear markets and chop.
TREND:=EMA(C,100);
UPPER:=REF(HHV(H,20),1);
LOWER:=REF(LLV(L,10),1);
MOM:=ROC(C,20);
ENTRY:C>UPPER && C>TREND && MOM>0;
EXIT:C<LOWER || CROSS(TREND,C);