OPEN-SOURCE SCRIPT
Undertow Backtest

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.
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的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。