OPEN-SOURCE SCRIPT

cd_VWAP_mtg_Cx

1 833
Cd_VWAP_mtg_Cx
Overview
The most important condition for being successful and profitable in the market is to consistently follow the same rules without compromise, while the price constantly moves in countless different ways.
Regardless of the concept or trading school, those who have rules win.
In this indicator, we will define and use three main sections to set and apply our rules.
The indicator uses the VWAP (Volume Weighted Average Price) — price weighted by volume.
Two VWAPs can be displayed either by manually entering date and time, or by selecting from the menu.
From the menu, you can select the following reference levels:
• HTF Open: Opening candle of the higher timeframe
• ATH / ATL: All-Time High / All-Time Low candles
• PMH / PML, PWH / PWL, PDH / PDL, PH4H / PH4L: Previous Month, Week, Day, or H4 Highs/Lows
• MH / ML, WH / WL, DH / DL, H4H / H4L: Current Month, Week, Day, or H4 Highs/Lows
Additionally, it includes:
• Mitigation / Order Block zones (local buyer-seller balance) across two timeframes.
• Buy/Sell Side Liquidity levels (BSL / SSL) from the aligned higher timeframe (target levels).
________________________________________
Components and Usage
1 – VWAP
Calculated using the classical method:
• High + Volume for the upper value
• Close + Volume for the middle value
• Low + Volume for the lower value
The VWAP is displayed as a colored band, where the coloring represents the bias.

Let’s call this band FVB (Fair Value Band) for ease of explanation.
The FVB represents the final line of defense, the buyer/seller boundary, and in technical terms, it can be viewed as premium/discount zones or support/resistance levels.
Within this critical area, the strong side continues its move, while the weaker side is forced to retreat.
But does the side that breaks beyond the band always keep going?
We all know that’s not always the case — in different pairs and timeframes, price often violates both the upper and lower edges multiple times.
To achieve more consistent analysis, we’ll define a new set of rules.
________________________________________
2 – Mitigation / Order Blocks
In trading literature, there are dozens of different definitions and uses of mitigation or order blocks.
Here, we will interpret the candlesticks to create our own definition, and we’ll use the zones defined by candles that fit this pattern.
For simplicity, let’s abbreviate mitigation as “mtg.”
For a candle to be selected as an mtg, it must clearly show strength from one side (buyers or sellers) — which can also be observed visually on the chart.
________________________________________
Bullish mtg criteria:
1. The first candle must be bullish (close > open) → buyers are strong.
2. The next candle makes a new high (buyers push higher) but fails to close above and pulls back to close inside the previous range → sellers react.
It also must not break the previous low → buyers defend.
3. In the following candle(s), as long as the first candle’s low is protected and the second candle’s high is broken, it indicates buyer strength → a bullish mtg is confirmed.
When price returns to this zone later (gets mitigated), the expectation is that the zone holds and price pushes upward again.
If the low is violated, the mtg becomes invalid.
In technical terms:
If the previous candle’s high is broken but no close occurs above it, the expectation is a reversal move that will retest its low.
Question:
What if the low is protected and in the next candle(s) a new high forms?
Answer: → Bullish mtg.
スナップショット

Bearish mtg (opposite)
スナップショット

3 – Buy/Sell Side Liquidity Levels
With the help of the aligned higher timeframe (swing points), we will define our market structure framework and set our liquidity targets accordingly.
スナップショット

Let’s put the pieces together.
If we continue explaining from a trade-focused perspective, our first priority should be our bias — our projection or expectation of the market’s potential movement.
We will determine this bias using the FVB.
Since we know the band often gets violated on both sides, we want the price action to convince us of its strength.
To do that, we’ll use the first candle that closes beyond the band.
The distance from that candle’s high to low will be our threshold range
Bullish level = high + (candle length × coefficient)
Bearish level = low - (candle length × coefficient)
When the price closes beyond this threshold, it demonstrates strength, and our bias will now align in that direction.
How long will this bias remain valid?
→ Until a closing candle appears on the opposite side of the band.
If a close occurs on the opposite side, then a new bias will only be confirmed once the new threshold level is broken.
During the period in between, we have no bias.
Let’s continue on the chart:
スナップショット

Now that our bias has been established, where and how do we look for trade opportunities?
There are two possible entry approaches:
• Aggressive entry: Enter immediately with the breakout.
• Conservative entry: Wait for a pullback and enter once a suitable structure forms.
(The choice depends on the user’s preference.)
At this stage, the user can apply their own entry model. Let’s give an example:
Let’s assume we’re looking for setups using HTF sweep + LTF CISD confirmation.
Once our bias turns bearish, we look for an HTF sweep forming on or near an FVB or mtg block, and then confirm the entry with a CISD signal.
スナップショット

In summary:
• FVB defines the bias, the entry zone, and the target zone.
• Mtg blocks represent entry zones.
• BSL / SSL levels suggest target zones.
Overlapping FVB and mtg blocks are expected to be more effective.
The indicator also provides an option for a second FVB.
A band attached to a lower timeframe can be used as confirmation.
• Main band: Bias + FVB
• Extra band: Entry trigger confirmed by a close beyond it.

スナップショット
Mtg blocks can provide trade entry opportunities, especially when the price is moving strongly in one direction (flow).
スナップショット

Consecutive or complementary mtg blocks indicate that the price is decisive in one direction, while sometimes also showing areas where we should wait before entering.
スナップショット

Mtg blocks that contain an FVG (Fair Value Gap) within their body are expected to be more effective.
Settings:
The default values are set to 1-3-5m, optimized for scalping trades.

VWAP settings:
スナップショット

Main VWAP (FVB):
• Can be set by selecting a start time, manually entering date and time, or choosing a predefined level.
Extra VWAP (FVB):
• Set from the menu. If not needed, select “none.”
• Visibility, color, and fill settings for VWAP are located here.
• Threshold levels visibility and color options are also in this section.
• The multiplier is used for calculating the threshold level.
Important:
• If the Extra VWAP is selected but not displayed, you need to increase the chart timeframe.
o Example: If the chart is on 3m and you select WH from the extra options, it will not display correctly.
• Upper limits for VWAP:
o 1m and 3m charts: daily High/Low
o 5m chart: weekly High/Low
________________________________________
Mtg Settings:
スナップショット
• Visibility and color settings for blocks are configured here.
• To display on a second timeframe, the box must be checked and the timeframe specified.
• Optional display modes: “only active blocks,” “only last violated mtg,” or “all.”
• For confirmation and removal criteria, choosing high/low or close determines the source used for mtg block formation and deletion conditions.

BSL/SSL Settings:
• Visibility, color, font size, and line style can be configured in this section.

When “Auto” is selected, the aligned timeframe is determined automatically by the indicator, while in manual mode, the user defines the timeframe.

Final Words:
Simply opening trades every time the price touches the VWAP or mtg blocks will not make you a profitable trader. Searching for setups with similar structures while maintaining proper risk management will yield better results in the long run.
I would be happy to hear your feedback and suggestions.
Happy trading!


免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。