OPEN-SOURCE SCRIPT
PCA Projection Pulse [forexobroker]

PCA Projection Pulse runs Principal Component Analysis on a 2-D feature space (z-scored close, z-scored volume) over a rolling window. The first principal component is the direction of maximum joint variance; projecting the current point onto PC1 measures how strongly current price-and-volume aligns with that direction. Signals fire on edge crossings of the projection threshold.
🔶 ALGORITHM
1. zC = (close - mean_close) / sd_close; zV = (volume - mean_volume) / sd_volume.
2. 2x2 covariance matrix entries: s11 = var(close), s22 = var(volume), s12 = cov(close, volume).
3. trace = s11 + s22; det = s11 * s22 - s12^2; eigenvalue lambda1 = (trace + sqrt(trace^2 - 4 * det)) / 2.
4. PC1 eigenvector ~ (lambda1 - s22, s12); normalise to unit length (ux, uy).
5. Projection = zC * ux + zV * uy.
6. Pulse regime when |projection| >= threshold.
🔶 SIGNAL LOGIC
- Buy: projection >= +threshold edge AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: projection <= -threshold edge.
- Position-lock state machine.
🔶 INPUTS
- Covariance Window (default 40)
- Projection Threshold (default 0.50)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, xcross with PC text, PC1 direction line, buy / sell colors
🔶 ALERTS
PPP Buy, PPP Sell, PPP Any Signal, PPP Pulse Up, PPP Pulse Down, PPP Strong Pulse, PPP Single Direc, PPP Same Sign, PPP Webhook JSON.
🔶 LIMITATIONS
- 2-D PCA captures only the dominant joint direction; higher-D variants (more features) would extract richer signals but require larger covariance matrices.
- Closed-form eigendecomposition is exact for 2x2 cases; for richer feature spaces an iterative solver is needed.
- Forex tick volume noise can dominate PC1; assets with reliable volume produce cleaner pulses.
- The "PC1 direction line" is anchored at EMA20 and scales projection by ATR — visual cue, not a level.
🔶 ALGORITHM
1. zC = (close - mean_close) / sd_close; zV = (volume - mean_volume) / sd_volume.
2. 2x2 covariance matrix entries: s11 = var(close), s22 = var(volume), s12 = cov(close, volume).
3. trace = s11 + s22; det = s11 * s22 - s12^2; eigenvalue lambda1 = (trace + sqrt(trace^2 - 4 * det)) / 2.
4. PC1 eigenvector ~ (lambda1 - s22, s12); normalise to unit length (ux, uy).
5. Projection = zC * ux + zV * uy.
6. Pulse regime when |projection| >= threshold.
🔶 SIGNAL LOGIC
- Buy: projection >= +threshold edge AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: projection <= -threshold edge.
- Position-lock state machine.
🔶 INPUTS
- Covariance Window (default 40)
- Projection Threshold (default 0.50)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, xcross with PC text, PC1 direction line, buy / sell colors
🔶 ALERTS
PPP Buy, PPP Sell, PPP Any Signal, PPP Pulse Up, PPP Pulse Down, PPP Strong Pulse, PPP Single Direc, PPP Same Sign, PPP Webhook JSON.
🔶 LIMITATIONS
- 2-D PCA captures only the dominant joint direction; higher-D variants (more features) would extract richer signals but require larger covariance matrices.
- Closed-form eigendecomposition is exact for 2x2 cases; for richer feature spaces an iterative solver is needed.
- Forex tick volume noise can dominate PC1; assets with reliable volume produce cleaner pulses.
- The "PC1 direction line" is anchored at EMA20 and scales projection by ATR — visual cue, not a level.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
🔵Gain access to our powerful tools : kestutisbalciunas.com/tradingview/
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
🔵Gain access to our powerful tools : kestutisbalciunas.com/tradingview/
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.