OPEN-SOURCE SCRIPT

Undertow Backtest

716
STRATEGY — UNDERTOW BACKTEST [UNDR BT]

снимок

SHORT SUMMARY

The backtest engine for Undertow. Simulate the buy/sell dots across any asset and timeframe, and choose whether to trade only the strong signals or every crossover.

WHAT IT IS
Undertow Backtest is the strategy version of the Undertow indicator. It applies Undertow's buy and sell logic to historical data and reports how a simple long-only approach would have performed — net profit, win rate, drawdown, and a full trade list — in TradingView's Strategy Tester.

HOW IT WORKS
— Entry (long): on an Undertow buy signal
— Exit: on an Undertow sell signal

— You independently choose, via dropdowns, whether buys fire on strong dots only (crosses beyond the oversold bound) or on all dots (every upward cross), and likewise for sells.
This lets you compare four behaviors: patient (strong/strong), active (all/all), aggressive long-bias (all buys / strong sells), and defensive (strong buys / all sells).

SETTINGS
— All the same WaveTrend and threshold inputs as the indicator
— Buy On: Strong dots only / All dots
— Sell On: Strong dots only / All dots
— Default starting capital, position sizing, and commission are set in the strategy properties and can be edited

IMPORTANT LIMITATIONS — PLEASE READ
— The backtest fills orders at bar close and does NOT model slippage; real-world results would typically be worse.

— It is long-only and goes effectively all-in per signal by default; this is a simplification, not a recommended position-sizing method.

— Higher timeframes (weekly, monthly) produce few trades, which is too small a sample to draw firm conclusions from. Test across multiple assets and timeframes.

— Optimizing the settings until the backtest looks great ("curve fitting") usually produces results that fall apart on live data. Prefer settings that are robust across many markets over ones that are perfect on one.

CREDITS & BASIS
Based on the open-source WaveTrend Oscillator concept (LazyBear) plus a standard RSI. Published open-source.

DISCLAIMER
For educational purposes only. Not financial advice. Backtested performance is hypothetical and does not represent actual trading. No system guarantees future profits. Trade at your own risk and never risk more than you can afford to lose.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.