Cash Balance
$10,000.00
Available to deploy
$10,000.00
Portfolio Value
Total PnL
$0.00
vs $10,000 starting capital
Live Price · AAPL
—
ticks every 2s via WebSocket
Loading quotes…
Fast SMA (5)
Slow SMA (20)
Bullish candle
Bearish candle
Last candle updates live every 2s
Execution Ledger
0 trades
No trades yet — run the strategy to execute your first trade.
System Log
⚡ Strategy Rules — How The Algorithm Works
The Two Lines On The Chart
Fast SMA — Blue Line (5-period)
Average of last 5 closing prices. Reacts quickly. Represents short-term momentum — what the stock is doing RIGHT NOW.
Slow SMA — Yellow Line (20-period)
Average of last 20 closing prices. Moves slowly, filters noise. Represents the medium-term trend.
BUY
Fast crosses ABOVE Slow
Bullish crossover — short-term momentum stronger than trend. Algorithm buys 10 shares, cost deducted from cash balance.
SELL
Fast crosses BELOW Slow
Bearish crossover — momentum fading. Algorithm sells 10 shares, adds proceeds to cash, calculates PnL.
HOLD
No crossover on latest bar
Relationship unchanged — no trade executed. Algorithm only fires at the exact moment of a crossover, never continuously.
💡 Uses pandas .diff() on crossover position — fires only at the exact bar the relationship changes, preventing over-trading.
$ Dashboard Metrics — What Each Number Means
Cash Balancestarts at $10,000
Your liquid money not invested in any stock. Goes DOWN on BUY (spent on shares), UP on SELL (cash received). Like your bank account balance.
Portfolio ValueCash + Shares × Price
Total net worth = Cash Balance + current market value of all shares held. Fluctuates with stock price even without trading.
Total PnL (Profit & Loss)Portfolio − $10,000
The bottom line — how much you've made or lost vs your $10,000 start. Green = profitable, Red = losing. Per-trade PnL = (sell − buy) × shares.
💡 Strategy profits by BUYing on upward crossovers and SELLing on downward ones. Won't be right every trade — but statistically beats random over many trades.