PROTECTED SOURCE SCRIPT

QuantJazz Turbine Trader BETA v1.17

146
QuantJazz Turbine Trader BETA v1.17 - Strategy Introduction and User Guide

Strategy Introduction

Welcome to the QuantJazz Turbine Trader BETA v1.17, a comprehensive trading strategy designed for TradingView. This strategy is built upon oscillator principles, drawing inspiration from the Turbo Oscillator by RedRox, and incorporates multiple technical analysis concepts including RSI, MFI, Stochastic oscillators, divergence detection, and an optional FRAMA (Fractal Adaptive Moving Average) filter.

The Turbine Trader aims to provide traders with a flexible toolkit for identifying potential entry and exit points in the market. It presents information through a main signal line oscillator, a histogram, and various visual cues like dots, triangles, and divergence lines directly on the indicator panel. The strategy component allows users to define specific conditions based on these visual signals to trigger automated long or short trades within the TradingView environment.

This guide provides an overview of the strategy's components, settings, and usage. Please remember that this is a BETA version (v1.17). While developed with care, it may contain bugs or behave unexpectedly.

LEGAL DISCLAIMER: QuantJazz makes no claims about the fitness or profitability of this tool. Trading involves significant risk, and you may lose all of your invested capital. All trading decisions made using this strategy are solely at the user's discretion and responsibility. Past performance is not indicative of future results. Always conduct thorough backtesting and risk assessment before deploying any trading strategy with real capital.

This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

Core Concepts and Visual Elements
The Turbine Trader indicator displays several components in its own panel below the main price chart:

1. Signal Line (Avg & Avg2): This is the primary oscillator. It's a composite indicator derived from RSI, MFI (Money Flow Index), and Stochastic calculations, smoothed using an EMA (Exponential Moving Average).
  • Avg: The faster smoothed signal line.
  • Avg2: The slower smoothed signal line.
  • Color Coding: The space between Avg and Avg2 is filled. The color (Neon Blue/gColor or Neon Purple/rColor) indicates the trend based on the relationship between Avg and Avg2. Blue suggests bullish momentum (Avg > Avg2), while Purple suggests bearish momentum (Avg2 > Avg).
  • Zero Line Crosses: Crossovers of the Avg line with the zero level can indicate shifts in momentum.


2. Histogram (resMfi): This histogram is based on smoothed and transformed MFI calculations (Fast MFI and Slow MFI).
  • Color Coding: Bars are colored Neon Blue (histColorUp) when above zero, suggesting bullish pressure, and Neon Purple (histColorDn) when below zero, suggesting bearish pressure. Transparency is applied.
  • Zero Line Crosses: Crossovers of the histogram with the zero level can signal potential shifts in money flow.


3. Reversal Points (Dots): Dots appear on the Signal Line (specifically on Avg2) when the color changes (i.e., Avg crosses Avg2).
  • Small Dots: Appear when a reversal occurs while the oscillator is in an "extreme" zone (below -60 for bullish reversals, above +60 for bearish reversals).
  • Large Dots: Appear when a reversal occurs outside of these extreme zones.
  • Colors: Blue (gRdColor) for bullish reversals (Avg crossing above Avg2), Purple (rRdColor) for bearish reversals (Avg crossing below Avg2).


4. Take Profit (TP) Signals (Triangles): Small triangles appear above (+120) or below (-120) the zero line.
  • Bearish Triangle (Down, Purple rTpColor): Suggests a potential exit point for long positions or an entry point for short positions, based on the oscillator losing upward momentum above the 50 level.
  • Bullish Triangle (Up, Blue gTpColor): Suggests a potential exit point for short positions or an entry point for long positions, based on the oscillator losing downward momentum below the -50 level.


5. Divergence Lines: The strategy automatically detects and draws potential regular and hidden divergences between the price action (highs/lows) and the Signal Line (Avg).
  • Regular Bullish Divergence (White bullDivColor line, ⊚︎ label): Price makes a lower low, but the oscillator makes a higher low. Suggests potential bottoming.
  • Regular Bearish Divergence (White bearDivColor line, ⊚︎ label): Price makes a higher high, but the oscillator makes a lower high. Suggests potential topping.
  • Hidden Bullish Divergence (bullHidDivColor line, ⊚︎ label): Price makes a higher low, but the oscillator makes a lower low. Suggests potential continuation of an uptrend.
  • Hidden Bearish Divergence (bearHidDivColor line, ⊚︎ label): Price makes a lower high, but the oscillator makes a higher high. Suggests potential continuation of a downtrend.
  • Delete Broken Divergence Lines: If enabled, newer divergence lines originating from a similar point will replace older ones.


6. Status Line: A visual bar at the top (95 to 105) and bottom (-95 to -105) of the indicator panel. Its color intensity reflects the confluence of signals:
  • Score Calculation: +1 if Avg > Avg2, +1 if Avg > 0, +1 if Histogram > 0.
  • Top Bar (Bullish): Bright Blue (gStatColor) if score is 3, Faded Blue if score is 2, Black otherwise.
  • Bottom Bar (Bearish): Bright Purple (rStatColor) if score is 0, Faded Purple if score is 1, Black otherwise.


Strategy Settings Explained
The strategy's behavior is controlled via the settings panel (gear icon).

1. Date Range:
  • Start Date, End Date: Define the period for backtesting. Trades will only occur within this range.


2. Optional Webhook Configuration: (For Automation)
  • 3C Email Token, 3C Bot ID: Enter your 3Commas API credentials if you plan to automate trading using webhooks. The strategy generates JSON alert messages compatible with 3Commas. You can go ahead and just leave the text field as defaulted, "TOKEN HERE" / "BOT ID HERE" if not using any bot automations at this time. You can always come back later and automate it. More info can be made available from QuantJazz should you need automation assistance with custom indicators and trading strategies.


3. 🚀 Signal Line:
  • Turn On/Off: Show or hide the main signal lines (Avg, Avg2).
  • gColor, rColor: Set the colors for bullish and bearish signal line states.
  • Length (RSI): The lookback period for the internal RSI calculation. Default is 2.
  • Smooth (EMA): The smoothing period for the EMAs applied to the composite signal. Default is 9.
  • RSI Source: The price source used for RSI calculation (default: close).


4. 📊 Histogram:
  • Turn On/Off: Show or hide the histogram.
  • histColorUp, histColorDn: Set the colors for positive and negative histogram bars.
  • Length (MFI): The base lookback period for MFI calculations. Default is 5. Fast and Slow MFI lengths are derived from this.
  • Smooth: Smoothing period for the final histogram output. Default is 1 (minimal smoothing).


5.💡 Other:
  • Show Divergence Line: Toggle visibility of regular divergence lines.
  • bullDivColor, bearDivColor: Colors for regular divergence lines.
  • Show Hidden Divergence: Toggle visibility of hidden divergence lines.
  • bullHidDivColor, bearHidDivColor: Colors for hidden divergence lines.
  • Show Status Line: Toggle visibility of the top/bottom status bars.
  • gStatColor, rStatColor: Colors for the status line bars.
  • Show TP Signal: Toggle visibility of the TP triangles.
  • gTpColor, rTpColor: Colors for the TP triangles.
  • Show Reversal points: Toggle visibility of the small/large dots on the signal line.
  • gRdColor, rRdColor: Colors for the reversal dots.
  • Delete Broken Divergence Lines: Enable/disable automatic cleanup of older divergence lines.


6. ⚙️ Strategy Inputs: (CRITICAL for Trade Logic)
  • This section defines which visual signals trigger trades. Each signal (Small/Large Dots, TP Triangles, Bright Bars, Signal/Histogram Crosses, Signal/Histogram Max/Min, Divergences) has a dropdown menu:


  • Long: This signal can trigger a long entry.
  • Short: This signal can trigger a short entry.
  • Disabled: This signal will not trigger any entry.


  • Must Be True Checkbox: If checked for a specific signal, that signal's condition must be met for any trade (long or short, depending on the dropdown selection for that signal) to be considered. Multiple "Must Be True" conditions act as AND logic – all must be true simultaneously.


  • How it Works:

  • The strategy first checks if all conditions marked as "Must Be True" (for the relevant trade direction - long or short) are met.
  • If all "Must Be True" conditions are met, it then checks if at least one of the conditions not marked as "Must Be True" (and set to "Long" or "Short" respectively) is also met.
  • If both steps pass, and other filters (like Date Range, FRAMA) allow, an entry order is placed.


  • Example: If "Large Bullish Dot" is set to "Long" and "Must Be True" is checked, AND "Bullish Divergence" is set to "Long" but "Must Be True" is not checked: A long entry requires BOTH the Large Bullish Dot AND the Bullish Divergence to occur simultaneously. If "Large Bullish Dot" was "Long" but not "Must Be True", then EITHER a Large Bullish Dot OR a Bullish Divergence could trigger a long entry (assuming no other "Must Be True" conditions are active).


  • Note: By default, the strategy is configured for long-only trades (strategy.risk.allow_entry_in(strategy.direction.long)). To enable short trades, you would need to comment out or remove this line in the Pine Script code and configure the "Strategy Inputs" accordingly.


7. 💰 Take Profit Settings:
  • Take Profit 1/2/3 (%): The percentage above the entry price (for longs) or below (for shorts) where each TP level is set. (e.g., 1.0 means 1% profit).
  • TP1/2/3 Percentage: The percentage of the currently open position to close when the corresponding TP level is hit. The percentages should ideally sum to 100% if you intend to close the entire position across the TPs.
  • Trailing Stop (%): The percentage below the highest high (for longs) or above the lowest low (for shorts) reached after the activation threshold, where the stop loss will trail.
  • Trailing Stop Activation (%): The minimum profit percentage the trade must reach before the trailing stop becomes active.
  • Re-entry Delay (Bars): The minimum number of bars to wait after a TP is hit before considering a re-entry. Default is 1 (allows immediate re-entry on the next bar if conditions met).
  • Re-entry Price Offset (%): The percentage the price must move beyond the previous TP level before a re-entry is allowed. This prevents immediate re-entry if the price hovers around the TP level.


8. 📈 FRAMA Filter: (Optional Trend Filter)
  • Use FRAMA Filter: Enable or disable the filter.
  • FRAMA Source, FRAMA Period, FRAMA Fast MA, FRAMA Slow MA: Parameters for the FRAMA calculation. Defaults provided are common starting points.
  • FRAMA Filter Type:
  • FRAMA > previous bars: Allows trades only if FRAMA is significantly above its recent average (defined by FRAMA Percentage and FRAMA Lookback). Typically used to confirm strong upward trends for longs.
  • FRAMA < price: Allows trades only if FRAMA is below the current price (framaSource). Can act as a baseline trend filter.
  • FRAMA Percentage (X), FRAMA Lookback (Y): Used only for the FRAMA > previous bars filter type.
  • How it Affects Trades: If Use FRAMA Filter is enabled:
  • Long entries require the FRAMA filter condition to be true.
  • Short entries require the FRAMA filter condition to be false (as currently coded, this acts as an inverse filter for shorts if enabled).


How to Use the Strategy

1. Apply to Chart: Open your desired chart on TradingView. Click "Indicators", find "QuantJazz Turbine Trader BETA v1.17" (you might need to add it via Invite-only scripts or if published publicly), and add it to your chart. The oscillator appears below the price chart, and the strategy tester panel opens at the bottom.

2. Configure Strategy Properties: In the Pine Script code itself (or potentially via the UI if supported), adjust the strategy() function parameters like initial_capital, default_qty_value, commission_value, slippage, etc., to match your account, broker fees, and risk settings. The user preferences provided (e.g., 1000 initial capital, 0.1% commission) are examples. Remember use_bar_magnifier is false by default in v1.17.

3. Configure Inputs (Settings Panel):
  • Set the Date Range for backtesting.
  • Crucially, configure the ⚙️ Strategy Inputs. Decide which signals should trigger entries and whether they are mandatory ("Must Be True"). Start simply, perhaps enabling only one or two signals initially, and test thoroughly. Remember the default long-only setting unless you modify the code.
  • Set up your 💰 Take Profit Settings, including TP levels, position size percentages for each TP, and the trailing stop parameters. Decide if you want to use the re-entry feature.
  • Decide whether to use the 📈 FRAMA Filter and configure its parameters if enabled.
  • Adjust visual elements (🚀 Signal Line, 📊 Histogram, 💡 Other) as needed for clarity.


4. Backtest: Use the Strategy Tester panel in TradingView. Analyze the performance metrics (Net Profit, Max Drawdown, Profit Factor, Win Rate, Trade List) across different assets, timeframes, and setting configurations. Pay close attention to how different "Strategy Inputs" combinations perform.

5. Refine: Based on backtesting results, adjust the input settings, TP/SL strategy, and signal combinations to optimize performance for your chosen market and timeframe, while being mindful of overfitting.

6. Automation (Optional): If using 3Commas or a similar platform:
  • Enter your 3C Email Token and 3C Bot ID in the settings.
  • Create alerts in TradingView (right-click on the chart or use the Alert panel).
  • Set the Condition to "QuantJazz Turbine Trader BETA v1.17".
  • In the "Message" box, paste the corresponding placeholder, which will pass the message in JSON from our custom code to TradingView to pass through your webhook: {{strategy.order.alert_message}}.
  • In the next tab, configure the Webhook URL provided by your automation platform. Put a Whale sound, while you're at it! 🐳
  • When an alert triggers, TradingView will send the pre-formatted JSON message from the strategy code to your webhook URL.


Final Notes

The QuantJazz Turbine Trader BETA v1.17 offers a wide range of customizable signals and strategy logic. Its effectiveness heavily depends on proper configuration and thorough backtesting specific to the traded asset and timeframe. Start with the default settings, understand each component, and methodically test different combinations of signals and parameters. Remember the inherent risks of trading and never invest capital you cannot afford to lose.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.