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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🔵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.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
🔵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.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.