STOKYDEX LIVEโ† back to dashboard

๐Ÿง  How the prediction engine works

The full back-end โ€” what data comes in, exactly what each method measures, how they combine into one score, and where it can be made smarter.

1 ยท Data pipeline (in โ†’ out)

MEXC REST
Min1/5/15 klines ร—600
โ†’ MEXC WebSocket
live ticks ยท trades ยท candles
โ†’ Engine
7 methods per second
โ†’ Score โˆ’100โ€ฆ+100
+ confidence
โ†’ Your browser
ticket ยท chart ยท push

On startup each market's history is fetched natively for every timeframe (so 5m and 15m each have 600 real candles, not aggregated approximations). Then a single MEXC websocket streams live trades, ticker and the forming candle; the server recomputes all indicators once per second and a 10-minute REST re-sync self-heals any gaps. Everything you see is MEXC's own market data.

2 ยท The seven methods (what predicts what)

Each method looks at the candles and votes a direction with a confidence 0โ€“100%. This is classic technical analysis โ€” each captures one real market behaviour:

MethodWhat it actually measuresWeight
EMA trendThree exponential moving averages (21/55/200). When the fast is above the slow and price is above the 200, the market is structurally rising. This is the backbone โ€” trend is the single most reliable edge.30
RSI 14Relative Strength Index โ€” is momentum healthy (55โ€“72) or exhausted/overbought (>72). Filters out chasing a move that's already spent.18
MACDDifference of two EMAs vs its signal line โ€” measures whether momentum is still accelerating. Rising histogram = fuel left in the move.15
Bollinger20-period band ยฑ2ฯƒ. A tight "squeeze" that then breaks a band signals a volatility expansion โ€” often the start of a fast move. High confidence when breaking out of a squeeze.14
VWAPVolume-Weighted Average Price for the session โ€” the day's fair value. Above it, buyers are in control; below it, sellers. Institutions anchor to VWAP.12
Volume surgeCurrent candle volume vs its 20-period average. A >1.8ร— surge confirms real conviction behind a move rather than a thin-liquidity fakeout.10
ADX gateAverage Directional Index โ€” trend strength, not direction. It doesn't vote; it multiplies the whole score ร—1.15 in a strong trend (ADXโ‰ฅ25) and ร—0.55 in chop (ADX<18), because signals lie in sideways markets.gate

3 ยท How they become one number

The score is a weighted, confidence-scaled vote, then gated by trend strength:

for each method:  contribution = direction(โˆ’1|0|+1) ร— weight ร— (confidence / 100)
score = ( ฮฃ contribution / ฮฃ weight ) ร— 100
score = score ร— ADX_multiplier          // ร—1.15 strong ยท ร—0.55 chop
score = clamp(score, โˆ’100, +100)
ScoreVerdict
โ‰ฅ +55STRONG LONG
+25 โ€ฆ +54LONG
โˆ’24 โ€ฆ +24NEUTRAL โ€” stand aside
โˆ’54 โ€ฆ โˆ’25SHORT
โ‰ค โˆ’55STRONG SHORT

Confidence

Separate from the score: confidence = how much the directional methods agree with the final verdict, weighted. Six of seven methods pointing the same way โ†’ high confidence. A split vote โ†’ low confidence even if the score crosses a threshold. That's the number in the "Methods used" panel.

4 ยท From verdict to a trade you can place

When there's a signal, the engine builds the ticket from ATR (Average True Range โ€” the market's live volatility):

stop-loss     = entry โˆ“ 1.2 ร— ATR      // stop breathes with volatility
take-profit 1 = entry ยฑ 1.2 ร— ATR      // risk:reward 1:1  (close 50%)
take-profit 2 = entry ยฑ 2.4 ร— ATR      // risk:reward 1:2  (let it run)
recommended leverage = clamp( round(0.5 / stop%), 2, 10 )   // Safe mode

In Degen mode the recommended leverage scales toward the market's real max (up to 500ร—) by confidence โ€” and the calculator always shows the liquidation distance versus your stop, with a red DANGER warning if leverage would liquidate you before the stop is hit.

5 ยท Honest limits (what it does NOT do)

6 ยท "Price went up but it still says SHORT?!"

This is normal for a trend-following system and usually correct. The verdict reads the whole trend (200-EMA, MACD, VWAP) โ€” not the last tick. In a downtrend, a small up-move is a pullback, and selling into a bounce is often a better short entry, not a reason to flip.

So the dashboard now shows a separate short-term momentum line on the ticket. When price is moving against the signal, you get an amber counter-move warning: the trend still favours the trade, but wait for the short-term move to stall before entering โ€” and if it keeps pushing against the signal, treat it as a possible early reversal and stand aside. The entry price on the ticket is now the live order-book fill price (bid for shorts, ask for longs), so it matches exactly what you'd get on MEXC.

7 ยท How we make it smarter (the roadmap)

  1. Multi-timeframe confluence โ€” only fire STRONG when 5m and 15m agree; require the higher timeframe as a directional filter. Removes most chop false-signals.
  2. Order-book & depth โ€” MEXC streams full depth; add bid/ask imbalance and large-wall detection to catch moves the candles haven't shown yet.
  3. Funding-rate signal โ€” extreme funding = crowded positioning; fade it. Cheap, high-value contrarian input already in the data.
  4. RSI / MACD divergence โ€” price makes a new high but momentum doesn't โ†’ early reversal warning, one of the few genuinely leading signals.
  5. Adaptive weights (self-learning) โ€” log every signal's outcome, then re-weight each method by its recent hit-rate per market. The engine tunes itself instead of using my hand-set numbers.
  6. Backtesting page โ€” replay the last N days so you (and the engine) can see the win-rate, average R, and drawdown of these exact rules before trusting size.
  7. Volatility-regime switch โ€” use trend-following rules in trends and mean-reversion rules in ranges, chosen automatically by ADX/Bollinger width.
  8. Machine-learning layer (later) โ€” once enough labelled outcomes accumulate, a gradient-boosted model can combine the same features with learned, non-linear weights.

Tell me which of these to build next โ€” backtesting and multi-timeframe confluence give the biggest accuracy jump for the least risk.