OPEN-SOURCE SCRIPT
Aggiornato

VWMA / SMA / TEMA Difference

4 574
This Study try to simulate Weakening and Strengthening trends on Bear(down) or Bull(up) movements.

It looks to VWMA - TEMA trend for Bull / Bear trend and looking for SMA - VWMA trend for Weak / Strong trends.

On default settings Line shows the difference between VWMA - TEMA and Columns show difference between SMA - VWMA. Suggesting to use this script for 5m intervals.

This is a personal work of mine. Using this script and taking decisions regarding to this script is only and only under responsibility of the trader!!!
Note di rilascio
I am back with new update. After presenting interactions between TEMA - SMA - VWMA, it's time to add EMA 200-50 interactions to the chart. It currently shows the gap between EMA 200 and EMA 50. As we know it is also critical to follow up long term of the moving averages. So with this addition people can see the gap and trend of this gap. In most of the long term market analysis this gap considered as a major risk points. especially if this gap drops to negative. (Mean Death Cross) which commonly shows that trend is going downward.

Taking any action beside with this chart is under responsibility of trader. These kind of signals are only SIGNALS. They give warnings about POSSIBLE but NOT EXACT trends.
--------------------------------------------------------------------------------------------------
Merhaba tekrardan. Calismalarimiza hizla devam ediyoruz. TEMA - SMA - VWMA arasindaki 3lu baglantiyi gosteren yapimiza bir de EMA 200 - EMA 50 farkini gosteren yapimizida ekledik. Buradaki amacimiz aslinda suydu. Gunluk bazda EMA 200 ve EMA 50'nin kesisimleri aslinda hareketli ortalamanin ivmesini belli eden bir gosterge. Genel anlamda bu gosterge bizler 200 mumluk uzun donem hareketin, 50 mumluk kisa donem hareketin farkini belirtir. Bu iki degerin yonleri bize kesinlik vermese de belli bir trendin olustugunu isaret eder.

Genelde EMA 50, EMA 200'un altina dogru hareket ederek keserse birbirlerini DEATH CROSS denilen bir yapi olusur. Bu yapida bize kisa vadede asagi yonlu hareket ettiginin sinyalini verir.

Bu verilere bakarak islem yapmak yine sizlerin sorumlulugundadir. Kullanilan her bir gosterge belli basli gerceklikler sunsada kesinlik yoktur.
Note di rilascio
- Added EMA 21-55 difference to see short period movement analysis
- Coloring offset had been changed to previous value to follow up the trend easier.
----------------------------------------------------------------------------------------------------
- EMA 21-55 fark hesaplamasi eklendi kisa vadeli hareket analizi yapabilmek adina.
- Renk sematigi 0 degeri yerine bir onceki degere gore belirlenecek sekilde degistirildi. Genel anlamda trend takibi yapilmasi adina daha kolaylik saglayacaktir.
Note di rilascio
Coloring scheme had been changed according to colors in EYMAs script.
Note di rilascio
Coloring had been fixed on Ema200 - EMA 50 differentiation
Note di rilascio
Trend followup had been changed to table. This will fix the issue about overwriten texts for trends.
Note di rilascio
Wrong status display issue had been fixed.
Note di rilascio
  • Switched to Pine Script V5.
  • Changed the Bull/Bear Showing algorithm
  • Added Missing information about Weakining Bear
Note di rilascio
What's New since V5

━━━ Moving Averages Now Drawn on the Chart (new) ━━━

The three moving averages that drive the whole study — SMA, VWMA and TEMA — are now plotted directly on the price chart, not just implied by the difference plots. You can finally see the exact lines whose gaps the indicator measures.

Each line is direction-aware: it's drawn bright while rising and dimmed while falling, so slope changes are visible at a glance.

  • SMA — yellow
  • VWMA — aqua
  • TEMA — lime (thicker)


━━━ Redesigned Distance Table (new) ━━━

The old distance readout has been rebuilt into a clear, at-a-glance panel that shows how far the Source (price) sits from TEMA and VWMA — and it now floats directly over the main price chart.

  • Title + headers — a "Distance from Price" title and TEMA / VWMA column labels, so the numbers are self-explanatory
  • Direction arrows — ▲ when price is above the MA, ▼ when below, so position reads instantly
  • Sign colors — green when price is above the MA, red when below
  • Δ bar row — the change since the previous bar (widening / narrowing), colored by momentum, replacing the old confusing prev/now stack
  • % of price — optional readout so the distance is comparable across symbols


New Distance Table settings:

  • Show Distance Table — toggle the panel on/off
  • Table Position — place it in any corner or center
  • Show Distance as % of Price — add the percentage readout


The table is drawn on the main chart alongside the moving averages.

━━━ Price-Relative Sideways Detection (fix) ━━━

The SIDEWAYS state now uses a threshold that is relative to price instead of a fixed absolute gap.

Previously the "flat" check compared the MA gaps against a hard-coded 0.1 in price units. That only made sense for assets priced around ~100. On low-priced symbols — sub-cent coins, for example — the MA gaps physically can't exceed 0.1, so the indicator was effectively stuck on SIDEWAYS all the time. On very high-priced assets it was the opposite: SIDEWAYS almost never triggered.

V6.1 replaces that with a percent-of-price threshold, so the same setting behaves consistently on any symbol, from fractions of a cent to five-figure prices.

  • Sideways Threshold (%) — new input. The maximum gap between the moving averages, as a percent of price, for the trend to count as SIDEWAYS. Default 0.1%.


How it works:

  • The threshold scales with price: threshold = price × (Sideways % / 100)
  • SIDEWAYS triggers only when both gaps — TEMA↔VWMA and VWMA↔SMA — are inside that threshold at the same time (all three MAs stacked tightly together)
  • Increase the % to widen what counts as flat, decrease it to tighten


━━━ Pine Script v6 ━━━

The script has been migrated from Pine Script v5 to v6 for continued compatibility and performance on the latest TradingView engine.

Note: because the old sideways value was absolute, existing charts may behave differently after updating — tune the new Sideways Threshold (%) to taste for the instruments you trade.

This is a personal study. Trading decisions based on this script are solely the responsibility of the trader — not financial advice.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.