Bonsai BX (Backtester)

bonsai_trade Uppdaterad   
In today's trading landscape, traders need precision and deep analytical tools to navigate the sea of strategies. The Bonsai Backtester is one such tool, meticulously designed to evaluate multiple trading strategies in an integrated manner.


🌳 Bonsai BX 🌳 Universal Strategy Testing

📘 Overview

A product of collaboration with the Bonsai community, this backtester is both a reflection of collective insights and a means to provide traders with data-driven insights on TradingView.

📌 Current Backtest

 • Dataset: BTCUSD daily candles from Coinbase, starting from March 2015.
 • Source Signals: The Bonsai indicator signals are employed for both long and short entries. These are directly visible on the publication chart.
 • Trading Assumptions:
  • Initial Capital: $1,000
  • Maximum Position Size: 10% of equity per trade
  • Stop Loss: 10% per position
  • Commission: 0.1%
  • Slippage: 100 ticks (1.00)

🛠 Key Features

The Bonsai BX is equipped with a range of features aimed at providing traders with a more comprehensive analysis environment:

Features on Chart

 • External Indicator Adaptability: Easily incorporate signals from both built-in and custom TradingView indicators.
 • Snapshot Table: Delivers on-the-spot insights into crucial strategy performance metrics, including equity, open profit, position size, and entry price. While these details are available in TradingView's 'Performance Summary' panel, we've integrated them directly onto the chart for a more streamlined and accessible viewing experience.
 • Trade Labels: Visualize profit metrics for individual trades directly on the chart, allowing for a more immediate grasp of trade outcomes.
 • Long & Short Behaviors: Modify long behaviors to either open new long positions while closing short ones, or simply to close short positions. Conversely, for short behaviors, opt to either initiate new short positions while closing any active long ones or simply close long positions.
 • Multiple Signals Integration: The tool can currently handle up to three different external signals for long and short trades.
 • Condition-based Initiation: Define whether longs and shorts are triggered when 'All Conditions Met' or just 'Any Single Condition Met'. This flexibility allows for a more nuanced trading approach. For example, if you're using a trade signal alongside the RSI, you can specify that a long position should only open when the trade signal is active and the RSI is below 30 at the same time. This lets you combine multiple signals or conditions for more precise trade initiation.
 • TP & SL Customization:
  • Single TP: Set a specific Take Profit percentage.
  • SL: Define a Stop Loss percentage and choose between a standard or trailing stop.
  • Trail From: Specify the starting point of the trailing stop, be it the breakeven point or a certain percentage.
 • Interface Theme: Users can select between light and dark themes for their interface.

Performance and Trailing

🎛 Using Bonsai BX

1. Add it to your TradingView chart.
2. Adjust script parameters and settings. Integrate external indicator signals as needed.
3. Activate the backtester to refine trading strategies.

Backtester Settings Menu

🪝 Webhook (Beta)

The Webhook functionality, now in beta, augments the Bonsai BX utility. This feature offers a more intuitive method for users to direct webhooks to trading bots, exchanges, and brokers. It simplifies the process by eliminating the need to adjust JSON structures or other payload formats, making alert automation more accessible.

📜 Feedback & Community

The feedback from the Bonsai community has been instrumental in the tool's development and will continue to shape its evolution. As part of our commitment to adaptive, smart trading, this script will continually be updated to meet the ever-changing requirements of traders.

❗️ Disclaimer

Backtesting tools, including the Bonsai BX, simulate trading strategies based on historical data. The following key points should be kept in mind:

1. Past Performance is Not Predictive: While backtesting can offer insights, it's essential to understand that past performance does not guarantee or predict future results. Historical data might not account for future market changes or unforeseen events.
2. External Influences: Market outcomes can be significantly influenced by various external factors like geopolitical events, economic announcements, and sudden shifts in market sentiment. Such factors are often not considered in backtesting simulations.
3. Market Dynamics: Elements like market volatility, liquidity constraints, and slippage can drastically alter expected outcomes. These dynamics might not always be accurately represented in backtest simulations.
4. Limitations of Simulated Trades: Backtesting operates under the assumption that historical trends and patterns will replicate. However, market conditions evolve, and what worked in the past might not necessarily be viable in the future.
5. Informed Decisions: Always base your trading decisions on a mix of comprehensive research, current market analysis, and risk assessment. Relying solely on backtested results can lead to misconstrued perceptions and potential pitfalls.
Trading involves risks, and it's crucial to be fully informed and cautious before making any investment decisions. Always consider seeking advice from financial experts or professionals when in doubt.
Update on Bonsai BX

  • Added new quick sources for long and short conditions to simplify condition settings.
  • Increased options for external sources in both long and short strategies.
  • Improved functionality to display trailing trigger plots exclusively during active periods.

Endast inbjudanskript.

Tillgången till detta skript är begränsat till användare som har godkänts av författaren och kräver vanligtvis betalning. Du kan lägga till det till dina favoriter men du kan bara använda det efter att ha begärt och fått författarens tillstånd. Kontakta bonsai_trade för mer information eller följ författarens instruktioner här under.

TradingView rekommenderar inte att du betalar för ett skript och använder det om du inte litar till 100% på författaren och förstår hur skriptet fungerar. I många fall kan du hitta ett bra alternativ med öppen källkod gratis i våra Community skripts .

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Författarens instruktioner

Explore this tool and a range of others at - For assistance, reach out to us at

Vill du använda det här skriptet i ett diagram?

Varning:Var god läs innan du begär åtkomst.