Bonsai BX (Backtester)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.
Bonsai
Bonsai OS (Oscillators)Bonsai OS combines four oscillators (RSI, CCI, Stochastic, MACD) in one interface. Features divergence detection, color-intensity, and insights into divergences. Assists traders in spotting potential pivot points.
═════════════════════════════════════════════════════════════════════════
🌳 Bonsai OS 🌳 Advanced Oscillator Suite
📘 Overview
Bonsai OS is a tool tailored for traders focusing on reversal strategies and those keen on identifying market divergences. Combining multiple oscillators into one unified interface, it aids traders in pinpointing potential pivot reversal points.
📌 Algorithm Logic
• Multi-Oscillator Integration: Bonsai OS calculates and integrates the values from four standard oscillators: RSI, CCI, Stochastic, and MACD. Each oscillator's value is derived from its respective mathematical formula, analyzing historical data points.
• Divergence Detection: The tool runs a series of comparisons between price action and oscillator values. When discrepancies (divergences) are observed, they are highlighted, suggesting potential market reversals.
• Price Strength Visualization: A gradient background that is determined by an average of the oscillator values in relation to their historical norms, thereby providing a visual cue about the current price strength, whether it is strong or weak.
• Alerts: Users can set up notifications based on specific divergence insights. Once set criteria are met, alerts are triggered.
🎯 Purpose
• For Professionals: Bonsai OS offers integrated oscillator readings, allowing a more in-depth market analysis.
• For Beginners: Simplified readings and visual cues make it easier for newcomers to understand oscillator indicators and market conditions.
🛠 Distinctive Elements
• Oscillator Fusion: Bonsai OS goes beyond just grouping oscillators. It looks for matching divergences across them, aiming to find stronger signals for market reversals.
• Divergence Indicators: Bonsai OS identifies divergence patterns between price trends and oscillator readings, highlighting their intensity with color variations.
• Insight into Failed Divergences: Recognizing not all divergences lead to reversals, Bonsai OS provides markers for potential false signals, helping traders exercise caution and fine-tune their strategies.
Getting Bullish/Bearish and Divergences
📊 Features
• Data Source Customization: Users have the flexibility to choose between default data inputs or adjust to their preferred price points (like High & Low).
• Combined Divergence Signals: Beyond individual oscillator divergences, Bonsai OS identifies instances when several oscillators indicate divergence at the same time.
• Adaptable Outputs: Outputs like 'Bullish Divergence ▲', 'Getting Bullish ▲', 'Getting Bearish ▼' and 'Bearish Divergence ▼' are plotted as non-displayable 1 or 0 for seamless integration into other custom indicators, ensuring a harmonious integration.
Here's an example of a custom indicator that can be used for inputting data from external sources:
//@version=5
indicator("My Script Template", overlay = true)
group_name = "External Source"
external = input.source(title = "Source", defval = close, inline = "external", group = group_name)
val = input.int(title = ">", defval = 0, inline = "external", group = group_name)
// Your logic follows here...
Bonsai OS as External Source
🎛 How To Use Bonsai OS
1. Select the desired oscillator.
2. Monitor the color changes for market condition insights.
3. Look out for divergence markers to anticipate potential market shifts.
4. If required, set up alerts for real-time updates.
Indicator Settings Menu
📜 Feedback & Continual Development
We welcome your feedback. It's essential for the continuous improvement of Bonsai OS and to better serve the TradingView community.
❗️ Disclaimer
Trading involves risks. Bonsai OS aims to provide an analytical tool to support traders, but it's essential to complement its insights with other research. Always seek advice from financial professionals and trade responsibly.
BonsaiBonsai is a tailored tech analysis tool for all traders. It uses dynamic thresholds, sensitivity modes, and averaging to identify market trends. Its scoring system, visual cues, and alerts offer an intuitive trading journey.
═════════════════════════════════════════════════════════════════════════
🌳 Bonsai 🌳 Trend Analysis Indicator
📘 Overview
Bonsai is designed to aid traders in recognizing market trends, utilizing sensitivity as its pivotal component.
📌 Script Logic
• Threshold-Based Trends: Bonsai sets dynamic thresholds based on market deviations from previous highs or lows to identify trend reversals.
• Signal Generation: After ascertaining the trend direction, Bonsai provides buy/sell signals from trend crossovers and crossunders.
• Returns & Scoring: Each signal's potential returns are calculated, considering asset-specific trading fees. A scoring system (1-10) is introduced for traders to evaluate potential profitability quickly.
• Auto-Threshold: Threshold adjustments are made depending on the selected sensitivity mode, optimizing adaptability.
• Visual Indicators: Bonsai visualizes potential market highs and lows through trend lines. Colors differentiate between bullish and bearish market sentiments.
• Trend Line Enhancement with ALMA : Bonsai integrates the Arnaud Legoux Moving Average (ALMA), aiming to refine trend line representation. ALMA may reduce noise, providing a smoother trend line, which might be useful during volatile market conditions. This can potentially lead to improved trend forecasts with fewer fakeouts.
🎯 Purpose
• For Experienced Traders: Bonsai complements professional analysis with its data-driven insights, catering to diverse trading strategies.
• For Newcomers: Serving as an entry to technical analysis, Bonsai's intuitive design and streamlined settings are beginner-friendly.
🛠 Key Elements
• Dynamic Thresholds: Bonsai’s thresholds are dynamic, adapting to market conditions and user-selected sensitivity mode.
• Scoring System: Bonsai’s unique scoring system is grounded on potential returns, streamlining complex market data interpretation.
Performance Table Breakdown
🔧 Classic Elements & Value Added
• Refined Moving Averages: Bonsai incorporates standard moving averages like the EMA, SMA and ALMA to smooth and refine trend lines.
• Enhanced Visual Representation: Bonsai strives to provide clarity beyond just displaying market directions. Its visuals are crafted to help traders understand and potentially act promptly. The deliberate use of color dynamics, trend indications, and integration of moving averages come together to create a representation that aims to stand out in its clarity and simplicity.
📊 Features
• Dynamic Sensitivity Modes : Settings include:
• (Auto) Slow, Mid, Fast : These modes allow Bonsai to auto-adjust its sensitivity in line with market changes.
• 'Slow': Aims to capture larger market moves with fewer signals.
• 'Mid': A balanced mode with a moderate signal frequency.
• 'Fast': Caters to rapid market changes, providing more signals.
• Manual : For traders who prefer setting their sensitivity.
• Visualization: Green indicates bullish trends, and Red indicates bearish ones. Trend colors are customizable in gradient intensity and opacity.
• Performance Insights : A table displaying the effectiveness of all modes, guiding your strategy choices.
• Dashboard Themes : Users can switch between light and dark themes.
• Alert System : Real-time buy/sell signal notifications.
• Compatibility : Output can be integrated as a source for other indicators.
Indicator Settings Menu
🎛 How To Use Bonsai
1. Select your sensitivity mode.
2. Use color cues to analyze market directions.
3. Check the performance insights for strategy adjustment.
4. Set alerts to stay updated.
📜 Feedback & Improvement
We value your feedback. As the trading world evolves, Bonsai will adapt, meeting traders' dynamic needs.
❗️ Disclaimer
Bonsai serves as an analytical tool and isn’t a standalone trading strategy. Its performance table is for reference, and accuracy isn’t guaranteed. Always research thoroughly and be mindful of trading risks. Bonsai facilitates analysis but doesn’t promise particular outcomes.
Moving Average Zone Indicator (MAZI) - Complete!Now with adjustable settings!
Description:
The MAZI (Moving Average Zone Indicator) is a slow updating moving average calculation of key high and low points in the market, which is a unique approach to sampling moving averages.
The indicator tracks only the key candles that provide good information about price movement, which distinguishes it from other moving average indicators that record a new data point with every bar that prints.
The length of the MAZI is determined by the number of key price points to reference in the average equation, not the number of candles to look at.
We have included our very own unique addition besides the ability to adjust the settings which is called: Standard Deviation Zones
Standard Deviation Zones:
A standard deviation takes a set of values and tells you with a certain level of confidence that with those data points where a potential next data point could land.
When we take our key pivot high and key pivot low points and calculate standard deviations away from them.
We can more confidently predict where the next turn around will be.
Of course the market is always changing and this is not a sure thing but it will still help us get an idea of what places for the next pivot is reasonable.
At the same time if the price breaks above the top standard deviation lines and below the bottom ones it’s a clear sign of a significant move or change in the market
The MAZI band uses specific candle conditions to sample the highs and lows of specific candles to calculate the top and bottom moving averages.
If the close of a candle is lower than the close of the previous two candles, the high of the previous candle is recorded as a potential pivot value.
If the close of a candle is higher than the close of the previous two candles, the low of the previous candle is recorded as a potential pivot value.
These pivot values are adjustable!
The upper and lower bounds of the moving average zone are calculated as one and two standard deviations away from the moving averages, respectively.
The MAZI provides a unique perspective on price movement that can help traders identify key zones of support and resistance.
The MAZI’s equation gives traders 5 crucial points of interest: the direction of the zone, the top of the zone, the middle of the zone, the bottom of the zone, and the height of the zone.
How to use each point of interest
The Direction:
Because we don’t use every candle for input into our calculations, the direction of the indicator will not change with insignificant moves in the markets allowing you to catch when something is a pull back vs when it is a real direction change.
We have also included 3 easy to read colors allowing you to gauge when direction is going down, flat, or up, by alternating the color of the zone between red, white, and green respectively.
The Top of the Zone:
The top of the zone represents where price would be expected to not go over given the length of the bars being calculated.
So this tells you that if the zone is red and the highs are not breaking over the top of the zone, the market is behaving as expected and it should continue down.
On the other hand, if price does break over the top of the zone it signifies stronger than expected buying power and price movement.
The strongest indication of strong upward movement is when the top of the zone becomes an area of price support.
So when you see a candle come down from above the zone and turn around near the top of the zone there is likely a strong upward move coming.
Unless there is a very strong trend it is best to only take this trade the first time price breaks the top side and forms support.
On a range day this is not likely to happen multiple times in a row without price testing the bottom side in between.
The Middle of the Zone:
The middle of the zone is used as a general no trade zone.
Because price is inbetween where the expected high and low of price should be there is no good indicator of which way price will break out.
That does not mean you cannot find worthwhile patterns in the middle of the zone but as a general rule and a very good rule for beginner traders is to avoid entering a trade inside the zone all together.
The Bottom of the Zone:
The bottom of the zone is used similarly to the top of the zone.
If the zone is green and lows are not going below the bottom of the zone the shows you that sellers are not breaking below the expected price and therefore you can expect the price to continue moving up.
On the other hand if price breaks below the low part of the zone then it shows you that sell’s have pushed price below the expected low and therefore is currently under strong selling pressure.
The strongest signal for a big downward move is when the low of the zone (the expected bottom of where price should be given the length of the indicator) turns into a resistance area for price.
When a candle comes up from underneath the zone and fails to break into the zone and starts to drop again, that is the best signal for a big downward move.
Unless there is a very strong trend it is best to only take this trade the first time price breaks the bottom side and forms resistance.
On a range day this is not likely to happen multiple times in a row without price testing the top side in between.
The Size of the Zone:
The size of the zone is very important to keep in mind when gauging profit targets and stop loss levels.
When the market is forming trending patterns the height of the zone will grow.
When the market is showing signs of ranging it will start to shrink.
In other words the smaller the zone the smaller your profit target should be (and the tighter stop you should have).
A zone with a large height shows that we have much larger moves requiring wider stops and its more likely to hit larger profit targets.