OPEN-SOURCE SCRIPT

Grid Bot v6 Strategy

766
Grid Bot v6 Strategy
Adaptive parabolic grid that turns market structure into a step-by-step trading plan
Idea of strategy and source code of base indicator provided by my subscriber Sergio_nov

1. Core concept
Grid Bot v6 draws a dynamic parabola from a user-defined time/price anchor and builds a 10-level grid around it (five lines above, five below).
Each level is colour-coded:

Green – preferred buy area

Red – preferred sell area

Yellow – overlap of buy-and-sell zones (balance)

Grey – neutral zone

Orders are fired when price touches or reverses from a grid line and the signal is confirmed by current market sentiment. If sentiment contradicts the signal, the order is tagged secondary and uses a reduced lot size.

2. How the logic works
Parabola – the function f_parabola computes the curve from Accel, Curve and Sensitivity. Zero values give a flat horizontal grid; non-zero values create an accelerating or decelerating trendline.

Grid spacing – controlled by Intervals (percentage of price). Lines are recalculated every bar, so the grid “breathes” with the market.

Triggers – choose which part of the candle must reach the level (Wick, Close, Midpoint, SWMA).

Confirmation – decide whether a simple touch is enough or a full reversal is required (Touch vs Reverse).

Sentiment filter – by default the slope of the parabola (up = long bias, down = short bias). You can override it to Long, Short or Neutral.

Order types – four independent sizes: Main Buy, Secondary Buy, Main Sell, Secondary Sell. Pyramiding up to 100 entries is allowed.

Visuals – the script plots actual and projected grid lines (100 bars ahead), the SWMA trigger and the parabola itself. Trade symbols: ▲ ▼ △ ▽.

3. User inputs
Strategy Settings

Main Buy Lot / Secondary Buy Lot

Main Sell Lot / Secondary Sell Lot

Grid Settings

Accel – tilt of the curve (positive for uptrend, negative for downtrend)

Curve – concavity; higher absolute value = stronger bend

Intervals – distance between grid lines (in %)

Sensitivity – how fast the parabola adapts; higher = more reactive

Buy Zones / Sell Zones – number of active lines below/above the curve

Trigger – Wick, Close, Midpoint, SWMA

Confirm – Touch or Reverse

Sentiment – Slope, Long, Short, Neutral

Show Signals / Show Selector – toggle on-chart markers and SWMA line

Chart Settings – individual colours for active grid, projection, parabola and SWMA.

Time/Price Anchor

B_Time – starting bar (e.g. a recent swing high/low)

B_Price – price at that bar

Tip: drop the anchor on a clear pivot, then tune Accel and Curve so the parabola hugs the trend.

4. Quick-start guide
Open your favourite symbol and timeframe (works best on volatile markets from 5-minute to 4-hour).

Set B_Time / B_Price to the last significant extreme.

Adjust Accel and Curve:

Uptrend – positive Accel, negative Curve for a concave support.

Range – both zero for a flat ladder.

Choose Intervals: smaller values = more frequent trades.

Limit Buy Zones and Sell Zones if you prefer a tighter grid.

Run a back-test, check P/L, max drawdown and trade count.

Fine-tune: lower Sensitivity if the curve outruns price; switch Trigger to SWMA to filter noise.

5. Pros and cons
Strengths

Adaptive levels that keep up with trend acceleration.

Clear colour coding plus forward projection for better context.

Sentiment filter reduces counter-trend exposures.

Weaknesses

Many parameters – each asset/timeframe needs its own calibration.

In narrow ranges frequent fills can accumulate fees.

pyramiding = 100 grows exposure quickly; monitor margin closely.

6. Risk disclaimer
This script is for educational and research purposes only. Historical performance does not guarantee future results. Before going live:

Forward-test bar-by-bar;

Check that your broker supports similar order handling;

Apply sound position sizing and, where appropriate, stop-losses or hedging.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。