OPEN-SOURCE SCRIPT

Master Weekly Vector Forex

194
Weekly Vector Forex indicator is essentially a combined volume/vector + mitigation + gap + multi-timeframe trend + weekly POC framework. It is designed to answer several different questions on one chart: where unusually strong volume appeared, whether price has returned to those areas, where gaps remain open, where weekly volume concentrated, and how far current price sits above or below important moving averages.

Here is what each part is doing.

1. Vector candles

The foundation is the Traders Reality/PVSRA vector-candle calculation from the imported library.

The candles are separated into four vector types:

Green — major bullish vector
Red — major bearish vector
Blue — secondary bullish vector
Violet — secondary bearish vector

Normal candles remain grey/dark grey.

The point of a vector candle is not simply that price moved strongly. The PVSRA calculation uses volume and candle spread to identify unusually active candles. So you're effectively highlighting areas where activity was substantially different from the surrounding market.

You also have the option to recolor the actual chart candles using those vector colors.

2. Vector shadows / unmitigated vectors

This is one of the main features we built.

When a vector appears, the indicator creates a horizontal zone extending to the right.

So instead of losing sight of an important vector after another 50 or 100 candles appear, its price area remains visible.

Conceptually:

VECTOR
██████────────────────────────────────────────→

price has not returned here
= UNMITIGATED VECTOR

You can define the zone using either:

Body only

or

Body + wick

That gives you control over how strict you want the vector recovery calculation to be.

3. Unmitigated, partially recovered and fully recovered

The indicator tracks the lifecycle of each vector.

An untouched vector remains an unmitigated vector.

If price starts entering the vector area, it becomes partially recovered.

For example:

Vector originally:

████████████████████ 100%

Price returns:

████████░░░░░░░░░░░░

40% recovered
60% left

The indicator can therefore display:

40% REC
60% LEFT

This is useful because there is a large difference between a completely untouched vector and one that has already been 95% mitigated.

4. The shadow actually shrinks

The recovery isn't merely a label.

As price penetrates the vector, the remaining box is adjusted to represent the unrecovered portion.

That means visually you're concentrating on the part of the vector that price has not yet revisited.

Once it reaches 100%, it is considered completely recovered.

5. Fully recovered vectors become green

Once the vector reaches 100% recovery, it stops extending indefinitely.

The completed zone is retained as a historical recovered area and displayed in:

Green with 70% transparency.

You can control how many recently recovered zones remain visible.

For example:

RED/BLUE/VIOLET/GREEN SHADOW → outstanding vector

ORANGE → partially recovered

GREEN 70% transparent → completely recovered

This makes it much easier to distinguish old completed business from outstanding areas.

6. Gap detection

We also kept your gap system.

The indicator searches for price gaps and extends those areas horizontally.

You have separate bullish and bearish gap colors.

The gap remains visible until price fills it.

So you effectively have two different kinds of outstanding areas:

VECTOR ZONES
Volume-driven areas

GAP ZONES
Price discontinuities

They are related concepts but they are deliberately tracked separately.

7. Multi-timeframe SMA dashboard

The table in the upper-right is your broader market-location dashboard.

You currently have:

1H 4H 8H 1D 3D 1W 1M 6M 1Y 2Y 3Y 5Y
SMA 30
SMA 50
SMA 200

For each timeframe, the script calculates how far current price is from that SMA.

TradingView's request.security() evaluates the SMA inside the requested timeframe rather than simply calculating an SMA of duplicated higher-timeframe values. That's the correct architecture for a multi-timeframe SMA calculation.

The calculation is essentially:

Distance=
SMA
CurrentPrice−SMA


×100

Therefore:

+3.20% means price is 3.20% above the moving average.

−3.20% means price is 3.20% below it.

And we made the visual rule very simple:

🟢 Green = above SMA

🔴 Red = below SMA

You don't need additional "bullish" or "bearish" text because the sign and color already communicate it.

8. Important point about the very long SMA columns

There is one distinction you should understand.

The genuine TradingView timeframes are straightforward through:

1H / 4H / 8H / 1D / 3D / 1W / 1M / 6M / 1Y

Pine timeframe strings are defined as a multiplier plus a supported unit, and request.security() uses those timeframe contexts to evaluate the requested expression.

The 2Y / 3Y / 5Y columns in our current version are constructed from annual (12M) data because the direct 24M, 36M, and 60M implementation we initially tried was invalid.

There is also a practical limitation: something such as a true SMA 200 of five-year candles would require an extraordinary amount of historical data.

So I would treat the extreme long-term columns differently from your core 1H–1Y signals.

Your most actionable dashboard is really:

1H → immediate
4H → short-term structure
8H → intermediate
1D → daily
3D → broader swing
1W → macro structure
1M → major macro
6M → very long-term
1Y → structural extreme
9. Weekly POC

Another major component is the weekly Point of Control.

Your script collects price and volume throughout each week and estimates the price bucket that accumulated the most volume.

That becomes the week's POC.

Conceptually:

Price

1.1850 ███
1.1800 █████
1.1750 ███████████████ ← POC
1.1700 ███████
1.1650 ███

The POC is therefore an approximation of the week's highest-volume price area.

One qualification: this is not exchange-level centralized Forex volume profile. Spot FX is decentralized, and your script is constructing the POC from the volume data available through the chart feed.

So I would call it an approximate weekly POC based on TradingView's available volume data, not an absolute global FX POC.

10. Monday defines the week

We designed the weekly structure around:

Monday → start of trading week

with the completed weeks stored backwards:

THIS WEEK
W-1 = last week
W-2 = two weeks ago
W-3 = three weeks ago
...

That makes the historical structure intuitive.

You don't have to calculate dates mentally.

11. Each previous week can have its own color

You specifically wanted to be able to visually separate weeks.

So there are individual settings for:

W-1
W-2
W-3
W-4
...
W-13

You can assign a different color to every one.

This becomes useful when several weekly POCs are relatively close together.

Instead of seeing eight identical horizontal lines, you immediately know which week produced which level.

12. The POC lines are horizontal

We fixed the earlier problem where the current-week drawing was interfering with your most recent candles.

The intended representation is:

──────────────────────────── W-1 POC

not:

|
|
|
|

The whole purpose is to identify a price level, so horizontal representation is appropriate.

13. Current-week POC can start later

You also wanted the current week's developing POC not to interfere with the beginning of the week's chart.

There is therefore a setting:

Display Current Week From

with:

Monday
Tuesday
Wednesday
Thursday
Friday

The default we used was Wednesday.

Historical completed weeks are still retained normally.

This only controls when the developing THIS WEEK POC becomes visible.

14. Weekly POC percentage

Beside the POC, the indicator calculates the distance between current price and that POC.

For example:

W-1 | 17 Aug 2026 | POC 1.16850 | +1.42%

means current price is approximately 1.42% above last week's POC.

A negative result:

-0.83%

means current price is below that POC.

That gives you more information than simply drawing a horizontal line.

15. Label collision protection

This was another important change.

Originally the weekly POC labels and vector recovery labels could overlap.

You could end up with:

W-2 POC 1.16...
48% REC
52% LEF...

on top of each other.

The current system reserves the price locations occupied by vector labels and then searches for a free location for the weekly label.

If it needs to move the weekly label away from its actual POC, it uses a small dotted connector to show which level the label belongs to.

Also:

Vector labels stay closer to price.

Weekly labels are positioned farther to the right.

That separates the two information systems.

16. You can control the amount of information

There are multiple visibility and size controls.

You can independently control things such as:

SMA table on/off
Weekly POC on/off
Current-week POC on/off
Weekly labels on/off
Vector shadows on/off
Partial-recovery percentages on/off
Recovered zones on/off
Gaps on/off
Vector text size
Weekly text size
SMA table text size
Number of historical weeks
Number of recovery labels
Number of recovered vectors retained

That's important because this indicator contains a lot of information. On a 3-minute chart you may want a different visual configuration than on a daily chart.

17. What the indicator is actually telling you

The strongest way to use it is not to treat any single component as an automatic buy/sell signal.

Instead you're building confluence.

Imagine price is approaching an old area and you see:

Unmitigated bearish vector

Previous weekly POC

SMA 200

Weekly structure bearish

That is much more interesting than finding a random red vector.

Likewise:

Old bullish vector partially recovered
+
Major gap
+
W-2 POC
+
Price above 30/50/200 SMA on 4H
+
Price above 30/50 SMA on 1D

Now you're looking at several independent pieces of information around the same price region.

That is where this indicator becomes useful.

The way I'd mentally divide it

Think of Master Weekly Vector Forex as four layers:

Layer What you're asking
Vectors Where did abnormal volume/activity appear?
Recovery + gaps What areas has price not finished revisiting?
Weekly POC Where did weekly volume concentrate?
SMA dashboard Where is price relative to broader trend structure?

The chart itself gives you the location.

The SMA table gives you the multi-timeframe environment.

And the recovery system tells you which historical areas are still outstanding versus already completed.

One technical point to keep in mind: request.security() can include developing/unconfirmed higher-timeframe values on realtime bars depending on how the request is structured, so the current SMA dashboard should be considered live/developing for an unfinished higher-timeframe candle rather than assumed to be a permanently confirmed historical value. TradingView explicitly documents that distinction.

That is the full logic of the indicator as it stands now.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.