Online Logistic Forecaster [forexobroker]

818
Online Logistic Forecaster trains a single-feature logistic regression in real time via stochastic gradient descent. The feature is the standardised price-EMA distance; the target is "next bar closes higher". Each bar updates weight w := w - eta * (sigmoid(w * x) - y) * x. Forecast probability of next-bar up = sigmoid(w * x). Adaptive learning without batch training.

🔶 ALGORITHM

1. EMA = ema(close, len); ATR = atr(14).
2. Feature x = (close - EMA) / ATR (ATR-normalised distance).
3. Online SGD step: y_prev = (close[1] > close[2]); w := w - eta * (sigmoid(w * x[1]) - y_prev) * x[1].
4. Forecast: p_up = sigmoid(w * x).
5. Bull bias when p_up >= upper threshold; bear bias when <= lower threshold.

🔶 SIGNAL LOGIC

- Buy: bull bias edge (cross above upper threshold) AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: bear bias edge.
- Position-lock state machine.

🔶 INPUTS

- Feature EMA Length (default 20)
- Learning Rate eta (default 0.05)
- Buy Probability (default 0.60)
- Sell Probability (default 0.40)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, sigmoid line, buy / sell colors

🔶 ALERTS

OLF Buy, OLF Sell, OLF Any Signal, OLF Bull Edge, OLF Bear Edge, OLF High Conf Up, OLF High Conf Dn, OLF Strong Weight, OLF Webhook JSON.

🔶 LIMITATIONS

- One feature gives a 1D logistic forecast; multi-feature models would be more powerful but require explicit weight management.
- SGD with high eta can oscillate; defaults (eta = 0.05) balance convergence vs adaptation.
- The model needs warm-up of dozens of bars before w stabilises; early bars produce noisy forecasts.
- The "sigmoid line" visual is anchored at the EMA and scaled by ATR — purely informational.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.