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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน