Appearance

Personalize your experience

Mode
Accent Color
Layout
Direction

MACD Enhanced

FeaturedFree

MACD with colour-graded histogram and divergence detection

4.6(198)
5.2k installs 870 2 comments
V
2 listings640 followers

Algorithmic trader focused on momentum and market structure.

View Profile
macdoscillatordivergencemomentum
Free
Open in QuaTick IDE Edit in IDE
Version1.1.0
Updated2025-09-05
Compatiblecandlestick, heiken-ashi

Live Preview — BTC/USDT

About

Enhanced MACD with colour-graded histogram showing momentum acceleration/deceleration.


Outputs

MACD Line (fast EMA − slow EMA)

Signal Line (EMA of MACD)

Colour-graded histogram (4 colours)

Outputs & Parameters

Outputs

MACD Lineline
Signal Lineline
Histogramhistogram

Parameters

Fast Period12
Slow Period26
Signal Period9

Source Code

Edit in IDE
typescript
1// MACD Indicator — Quatick IDE
2// SDK math globals available: sma, ema, atr, rsi, macd, bollingerBands, vwap, etc.
3 
4const metadata = { id: 'macd', name: 'MACD', version: '1.0.0', category: 'momentum' };
5 
6interface BarData {
7 time: number;
8 open: number;
9 high: number;
10 low: number;
11 close: number;
12 volume?: number;
13}
14 
15const defaultParams = { fastLength: 12, slowLength: 26, signalLength: 9, source: 'close' };
16 
17function calculate(bars: BarData[], params = defaultParams): { time: number; value: number }[] {
18 const prices = bars.map(b => {
19 if (params.source === 'open') return b.open;
20 if (params.source === 'high') return b.high;
21 if (params.source === 'low') return b.low;
22 return b.close;
23 });
24 
25 // macd() is an SDK global: macd(data[], fast, slow, signal) -> { macd, signal, histogram }
26 const macdResult = macd(prices, params.fastLength, params.slowLength, params.signalLength);
27 
28 return bars
29 .map((bar, i) => ({ time: bar.time, value: macdResult.macd[i] }))
30 .filter(p => !isNaN(p.value));
31}
Read-only preview. Open in the QuaTick IDE to edit and deploy.

Reviews

No reviews yet. Be the first to review this listing.

Discussion

Sign in to join the discussion. Your posts and replies show up on your profile.