The math

No black box. Here are the formulas.

Textbook definitions on closed candles only, and the risk rules and the accounting written out just as precisely. Nothing here predicts prices: it is how ForecastsPro measures the market and limits what can happen to your money.

01Indicators

How it measures the market

Six textbook indicators, computed on closed candles only, on two timeframes for every coin. They describe the market; none of them predicts it.

Momentum

RSI — Relative Strength Index

n = 14Wilder smoothing

Gt=max(Ct−Ct−1,0) Lt=max(Ct−1−Ct,0)
G¯t=(n−1)⁢G¯t−1+Gtn RSI=100−1001+G¯/L¯

Average gain against average loss over 14 closed candles. The averages start as a simple mean and are then smoothed Wilder’s way (L̄ the same as Ḡ). A perfectly flat market reads 50; readings above 70 are conventionally called overbought, below 30 oversold.

Trend & momentum

EMA and MACD

12 / 26 / 9EMA seeded with an SMA

k=2n+1 EMAt=k⁢Ct+(1−k)⁢EMAt−1
MACD=EMA12−EMA26 Signal=EMA9(MACD)
Histogram=MACD−Signal

Two exponential averages of the close; the gap between them is momentum. The signal line smooths that gap, and the histogram shows whether momentum is building or fading. Each EMA starts from the simple average of its first n values.

Volatility

Bollinger Bands and %B

20 candles2 σ (population)

μ=120∑i=019Ct−i σ=120∑i=019(Ct−i−μ)2
Upper,Lower=μ±2σ %B=Ct−LowerUpper−Lower
Bandwidth=Upper−Lowerμ×100

A 20-candle average with a band two standard deviations either side. %B places the latest close inside the band — 0 at the lower edge, 1 at the upper, above 1 outside it — and bandwidth says how wide, that is how volatile, the market currently is.

Volatility

ATR — Average True Range

n = 14Wilder smoothing

TRt=max(Ht−Lt,|Ht−c|,|Lt−c|) c=Ct−1
ATRt=(n−1)⁢ATRt−1+TRtn ATR%=ATRP×100

The typical size of one candle, gaps from the previous close c included. It starts as the mean of the first 14 true ranges and is then smoothed. ForecastsPro reports it as a percentage of the price P, so a $60,000 coin and a $0.10 coin compare directly.

Trend strength

ADX with +DI and −DI

n = 14Wilder smoothing

ut=Ht−Ht−1 dt=Lt−1−Lt
DMt+=ut if ut>max(dt,0), else 0
DI±=100⋅S(DM±)S(TR) St=St−1−St−1n+xt
DX=100⋅|DI+−DI−|DI++DI− ADX=Wilder average of DX

+DI and −DI (DI⁺, DI⁻) say which side has been pushing — DM⁻ mirrors DM⁺ with d and u swapped, and S is Wilder’s running sum. ADX says how strongly a trend is running, whichever its direction. The DIs need 15 candles and ADX needs 28, because its first value averages 14 DX readings.

Context

Multi-timeframe trend label

SMA 50 / 200two timeframes

trend={ upP>SMA50>SMA200 downP<SMA50<SMA200 sidewaysotherwise dist200=P−SMA200SMA200×100

Each coin gets this label on its trading timeframe and on the next one up (1h with 4h, 4h with 1d, 1d with 1w), so a short-term signal is read against the bigger trend. Before 200 candles exist, price against SMA 50 must agree with EMA 12 against EMA 26. The label is context for the AI, not a gate rule.

02Risk rules

How it limits what can happen to your money

The risk gate’s sizing and kill switch, the protective orders and the accounting, then the three risk profiles, exactly as coded.

Risk gate

Position sizing: two caps, one min

budget Bcap share p

Ei=max(costi,valuei) D=∑iEi+unconfirmed buys
room=min(p⋅B−Ecoin,B−D)
size=min(proposed,room) rejected if room≤0

The AI proposes a size; the gate clamps it to whichever cap binds first — the per-coin cap or the total budget cap — and names it. Both caps count only what the bot bought, each position at the larger of what it cost and what it is worth, so neither a rally nor a drawdown makes them look roomier than they are. Buys approved earlier in the same cycle count too.

Risk gate

Daily-loss kill switch

rolling 24 hper venue

R24h=∑sells in last 24 h(proceeds−c¯⋅q) R24h<−ℓ⋅B⇒every buy is rejected

Realized profit and loss over the last 24 hours, average-cost basis, protective stop-loss and take-profit fills included. Past the limit, new buys pause until the losses roll out of the window. It blocks buys, never exits: sells and protective orders always go through, because they only reduce risk. A sell with no recorded cost basis counts as zero, never as profit.

Accounting

Cost-basis P&L (average cost)

per exchange accountnet of fees

buy q for v: Q←Q+q,K←K+v c¯=K/Q
sell q for v: realized=v−c¯⋅q Q←Q−q,K←c¯⋅Q
unrealized=Q⋅P−K

Positions and profit and loss are replayed from your journal’s filled orders, one book per venue and exchange account, so paper results never mix with real ones. Quantities are what really filled, net of commission; proceeds are net of the fee. Coins you already held are never part of it.

Protection

Stop-loss / take-profit bracket

one-cancels-the-otherafter every buy

SL=entry⋅(1−s) TP=entry⋅(1+τ)
SL≤P⋅(1−0.005) TP≥P⋅(1+0.005)

A take-profit limit above and a stop below, from your own levels or the risk profile’s (s, τ in the table below); a level the market has already passed is moved just past the current price P. The stop sells at market where the pair supports it, otherwise as a stop-limit 0.5% under its trigger. A stop does not guarantee the exit price.

The risk profiles, exactly as coded

Percentages are of your budget B. Stop-loss and take-profit are defaults you can change.

Risk levelLowMediumHigh
Per-coin cap p5%15%30%
Daily-loss limit ℓ2%5%10%
Min. confidence0.700.600.50
Stop-loss s3%5%10%
Take-profit τ6%10%20%

Every buy and sell also needs the coin on your watchlist, a confidence at or above the minimum, and no earlier order for that coin still waiting for the exchange to confirm it. These limits reduce risk; they do not remove it, and none of this predicts returns.

Paper first. Stay in control.

Create your account and pay on one page. Then watch these rules at work with play money, on the exchange testnet, before any of your trading capital is at risk.