DisDev

[DisDev] D-I-Y Gridbot

🟩 This script is a “do-it-yourself” Grid Bot Simulator, used for visualizing support and resistance levels. Prices are divided into grids, or trade zones, that will trigger signals each time a new zone is entered. During ranging markets, each transaction is followed by a “take profit.” As the market starts to trend, transactions are stacked (compare to DCA ), until the market consolidates. No signals are triggered above the upper gridline or below the lower gridline. Unlike the previous version, all grids may be adjusted in real-time by dragging the gridlines up and down to the desired support and resistance levels.

When adding the indicator to a new chart, you must choose six grid levels by clicking on the desired support or resistance price. You can change all of these levels at any time directly on the chart.

OVERVIEW

The D-I-Y Gridbot is an interactive tool designed for visualizing support and resistance levels. As a continuation of the original Gridbot Simulator, which has received significant recognition on TradingView, earning over 4000 boosts and an Editor's Pick status. This tool serves not only as an evolved version of its predecessor, but also as an open-source template for developing future gridbots. It aims to foster discussions and facilitate innovations around grid-trading strategies.

One of the new features of this gridbot is the real-time adjustability of all gridlines. Users can move these lines up and down to set their desired support and resistance levels in response to changing market conditions. Additionally, the D-I-Y Gridbot is compatible with multiple timeframes and can be used on most TradingView charts.

Drag gridlines up or down to desired price level.

Key Features 🔑
  • All gridlines are adjustable in real-time, directly on the chart
  • Signals can be filtered by a customizable moving average or by VWAP
  • Customizable support and resistance levels
  • Potentially increases profitability in ranging markets

Benefits 💸
  • Customizable Support and Resistance Levels: The D-I-Y Gridbot allows users to set their preferred support and resistance levels, which can be changed at any time directly on the chart. This provides users with the ability to customize their trading parameters based on their strategy and risk tolerance​​.
  • Various Trading Strategies: The D-I-Y Gridbot supports various trading strategies, including Mean Reversion, Ranging Markets, and Dollar-cost averaging (DCA). This allows users to capitalize on price reversals, execute buy and sell orders at predetermined levels, and buy more of an asset as the price falls, respectively​.
  • Multi-Timeframe and Versatility: The D-I-Y Gridbot is compatible with multiple timeframes and can be used on any TradingView chart.
  • Experimental and Educational: The D-I-Y Gridbot is considered a proof-of-concept tool that is both experimental and educational. This can provide traders with a deeper understanding of grid trading strategies and the ability to experiment with different trading parameters and strategies​.

⚙️ CONFIGURATION & SETTINGS ⚙️

Inputs 🔧
  • Trigger: Candle location to trigger the signal. "Wick" will use either high or low, depending on the signal direction. "Close" will use the close price. “MA” will use the selected moving average or VWAP.
  • Confirmation: Market direction to confirm the candle trigger. "Reverse" will confirm the signal when the price crosses back over the trigger. "Breakout" will confirm when the price breaks out of the trigger.
  • Number of Support/Resistance zones: 1 = Only Top Grid is Support/Only Bottom Grid is Resistance. 2 = Top two grids are Resistance/Bottom two grids are Support. 3 = Top three grids are Resistance/Bottom three grids are Support
  • MA Type: Exponential Moving Average (EMA), Hull Moving Average (HMA), Simple Moving Average (SMA), Triple Exponential Moving Average (TEMA), Volume Weighted Moving Average (VWMA), Volume Weighted Average Price (VWAP)
  • MA Filter: Use Moving Average as a reversion filter for signals. When enabled, no buys when above MA, no sells when below. Use in conjunction with S/R zones to reduce false signals.
  • Allow Repeat Signals. When enabled, signals will reset when nearest gridline is triggered. When disabled, only one signal will be triggered per gridline.
  • Line/Fill colors
  • Gridlines. Adjusts gridline prices manually.

Left: Trigger = Wick. Confirm = Breakout. Buys are signaled when LOW breaks below gridline. Sells are triggered when HIGH breaks above gridline.
Right: Trigger = Close. Confirm = Breakout. Buys are signaled when the candle CLOSES below the gridline. Sells are triggered when the candle CLOSES above the gridline.



Left: Confirm=Breakout. Signals on breaking through the next gridline.
Right: Confirm=Reverse. Signals only when crossing back from the gridline.



S/R Zones=1. Upper gridline is Resistance / Lower is Support. Middle 4 are neutral.

S/R Zones = 3. Upper three gridlines are Resistance / Lower three are Support


Notes:
  • If gridlines are dragged out of order on a live chart, they will auto-sort into the correct order.
  • Price levels may be entered in settings, or adjusted in real-time directly on the chart.
  • When changing symbols, remember to adjust the gridlines to accommodate the new symbol.

Alerts 🔔
  • Users can set alerts based on their chosen parameters for triggers, confirmations, number of support/resistance zones, and smoothing type, enabling precise control over alert conditions.


    💡 USAGE & STRATEGY 💡

    Trading Strategies 📈
  • Mean Reversion: The script can be used to capitalize on price reversals back to the mean.
  • Ranging Markets: The script excels in ranging markets, executing buy and sell orders at predetermined levels.
  • Dollar-cost averaging (DCA): The script can be used to execute DCA orders, buying more of an asset as the price falls, and lowering the average cost per unit.

    Timeframes and Symbols
    • Multi-Timeframe: The indicator is compatible with multiple timeframes.
    • Versatile: Can be used on any crypto trading pair on TradingView.


    🤖 DETAILS & METHODOLOGY 🤖

    Algorithm and Calculation 🛡️
    • Grids are set and adjusted when loading the indicator on the chart and may be customized anytime afterward by clicking and dragging the gridlines on the chart.
    • Gridlines are updated, sorted, and stored in a float array.
    • Signals are calculated based on candle trigger, market direction, and previous price level.


    📚 ADDITIONAL RESOURCES 📚

    Chart Examples 📊
    S/R Zones = 3: Three Support and Three Resistance. Filter = 50-period Triple Exponential Moving Average (TEMA)

    S/R Zones = 1: One Support, One Resistance, and Four Neutral Zones. Support Zones: Buys only. Resistance Zones: Sells only. Neutral Zones: Grid-dependent

    When MA filter is enabled, Buys are only triggered below Moving Average, and Sells are only triggered above.

    Trigger = Wick. Confirmation = Breakout. Buys are signaled when Low breaks above the next grid level. Sells are signaled when High breaks below the next grid level.


    🚀 CONCLUSION 🚀

    The D-I-Y Gridbot is a proof-of-concept, emphasizing its experimental and educational nature. In future versions, we will aim to incorporate concepts such as auto-adjusting grids and angled grids for trending markets. The script is designed to evolve through user feedback and suggestions, shaping its future iterations.

    Credit: This is a continuation of the Gridbot series by xxattaxx-DisDev. Explicit permission was granted by user xxattaxx-disdev to re-use all Gridbot code and all materials without restrictions.


    ⚠️ DISCLAIMER ⚠️

    This indicator is a proof-of-concept and is considered experimental and educational. When gridlines are drawn in hindsight, signals appear to be predictive and valid. Future results may always vary when the trend direction changes. Comments and suggestions are encouraged.

    This indicator is provided as a tool for traders and should not be used as the sole basis for making trading decisions. Always conduct your own research and consider your risk tolerance before entering any trades.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?