DerBinAlpha v1.8.39
Deriv Volatility Index bot — multi-mode last-digit strategy with martingale recovery
DerBinAlpha is a browser-based algorithmic trading bot for Deriv's synthetic Volatility Indices. It analyses the last digit of every incoming price tick, detects statistical imbalances between Even and Odd outcomes, and places digit contracts automatically when conditions are met.
It runs entirely in a single HTML file — no installation, no server, no dependencies. Open in any modern browser and connect with your Deriv API token.
Install as App (PWA)
DerBinAlpha is a Progressive Web App. You can install it on any device — it runs in its own window, works offline, and behaves like a native app. No app store required.
Desktop — Chrome or Edge
- Open the app URL in Chrome or Edge
- Look for the install icon (⊕) in the right side of the address bar
- Click it → click "Install" in the prompt
- DerBinAlpha opens in its own window with no browser chrome
- It appears in your Start Menu (Windows) or Applications folder (macOS)
Android — Chrome
- Open the app in Chrome for Android
- Tap the ⋮ menu (three dots, top right)
- Tap "Add to Home screen"
- Tap "Add" in the confirmation dialog
- The DerBinAlpha icon appears on your home screen — tap it to launch
iOS — Safari
- Open the app in Safari — must be Safari, not Chrome or Firefox
- Tap the Share button (the box with an arrow pointing up, bottom toolbar)
- Scroll down and tap "Add to Home Screen"
- Tap "Add" (top right)
- The DerBinAlpha icon appears on your home screen
Updates
The app updates silently in the background via its service worker. When a new version is deployed, you will see an "App update available — reload to apply" message in the Activity Log on your next visit. No manual reinstall needed.
Getting Started
- Open
DerBinAlpha.htmlin Chrome, Edge, or Firefox - In the Connection panel, choose Legacy or API Key mode
- Paste your Deriv API token
- Select your market (default: Volatility 75 (1s) Index)
- Click Connect
- Review Trade Settings and Scanner Settings
- Click Start
Connection Modes
Legacy (Recommended)
Uses Deriv's shared App ID 1089 — the same used by Deriv's own SmartTrader. No markup, full 95% payouts. Token obtained from your Deriv Dashboard → API Token page.
API Key (PAT)
Uses a Personal Access Token from api.deriv.com plus your own App ID.
Why markup matters
| Markup | Payout | Break-even win rate | Status |
|---|---|---|---|
| 0% | 95% | 51.3% | Safe |
| 1% | 94% | 51.6% | Marginal |
| 3% | 92% | 52.2% | Avoid |
| 5% | 90% | 52.6% | Avoid |
Live / Demo Account Switching
Available in Legacy mode only. When you connect, Deriv's authorize response includes tokens for all accounts linked to your profile. DerBinAlpha stores these and shows a LIVE / DEMO toggle pill in the topbar.
- Switching re-authorises on the same WebSocket — no reconnect needed
- If the bot is running, it stops automatically before switching
- LIVE = real money account DEMO = virtual account
- Toggle does not appear if only one account type is found
How the Scanner Works
The scanner subscribes to live price ticks from Deriv's WebSocket API. Every tick price is examined and the last digit (0–9) is extracted using the market's pip_size to ensure digit 0 is never lost to floating-point truncation. Each digit is stored in a rolling 1,000-tick buffer.
Two-phase entry logic — every tick
Phase 1 — Signal evaluation (runs every tick, sets the target):
- Count digit frequency — how many times each digit appeared in the 1,000-tick window
- Calculate parity split — Even digits (0,2,4,6,8) vs Odd digits (1,3,5,7,9) as percentages
- Check parity threshold — if ODD% ≥ threshold OR EVEN% ≥ threshold, a candidate side qualifies
- Check digit strength — count how many individual digits on the qualifying side exceed the strength threshold
- Check min qualifying — require at least N digits above strength threshold
- Set entry target — if all conditions pass, identify the HOT digit for the qualifying side and store it as the entry target. No trade is placed yet.
Phase 2 — Entry gate (runs every tick, after phase 1):
- Is an entry target set?
- Does the current tick's digit equal the target HOT digit?
- If both YES — place trade. This is the only path to a buy.
Signal flow
└─► Extract last digit via pip_size → update 1,000-tick buffer
└─► Evaluate signal: parity + strength conditions met? ─ No ─► Clear target, keep scanning
└─► Yes: set entry target = HOT digit for qualifying side
└─► Current tick digit === target HOT digit? ─ No ─► Wait for next tick
└─► Entry gate opens → place trade
HOT & COLD Digits
HOT 🔥 — the digit that appeared most frequently in the current lookback window (green glow on scanner grid).
COLD ❄️ — the digit that appeared least frequently (red glow on scanner grid).
In v1.8.0, the HOT digit for the qualifying side (ODD or EVEN) is now the entry trigger. The bot waits for the live scanner cursor to land on the HOT digit before placing each trade. The HOT digit is re-evaluated every tick, so it updates automatically if the distribution shifts between runs.
Trade Settings
Dynamic Settings
The DYNAMIC checkbox in the Trade Settings header automatically recalculates stake, SL, and TP as your balance grows — using a $100 stepped tier system. Settings only change when your balance crosses a $100 boundary, not on every trade.
How tiers work
| Balance range | Tier used | Stake | SL | TP |
|---|---|---|---|---|
| Below $100 | $100 (minimum floor) | $0.35 | $15 | $8 |
| $100 – $199 | $100 | $0.35 | $15 | $8 |
| $200 – $299 | $200 | $0.47 | $20 | $10 |
| $300 – $399 | $300 | $0.71 | $30 | $15 |
| $400 – $499 | $400 | $0.94 | $40 | $20 |
| $500 – $599 | $500 | $1.18 | $50 | $25 |
| $1,000 – $1,099 | $1,000 | $2.37 | $100 | $50 |
Formula: tier = max($100, floor(balance ÷ 100) × 100). The tier is used to calculate stake — the raw balance is never used directly, so a balance of $187 and $142 both use the $100 tier and produce identical settings.
| Mode | Behaviour |
|---|---|
| Dynamic ON | After each trade closes, the bot checks which $100 tier your balance falls in. If the tier changed, settings update and the activity log shows: ⚡ Dynamic tier $200 (Bal $213.40) → Stake $0.47 | SL $20 | TP $10. Fields go read-only. Setting persists across reloads. |
| Dynamic OFF | Settings are static. Use the Risk Calculator manually or edit fields directly when you want to rebalance. |
Trade Side
| Setting | Behaviour |
|---|---|
| Both | Trades Even or Odd depending on scanner signal — recommended |
| Even only | Only places Even contracts regardless of signal |
| Odd only | Only places Odd contracts regardless of signal |
Daily Risk Controls
These three limits apply across all sessions in a trading day — not per-session. They prevent a profitable day from being eroded across multiple sessions. Set any value to 0 to disable that control.
stopBot(), shows a "Daily halt" banner in the Daily risk controls panel, and blocks the Start button until you press Reset to resume. Daily stats also auto-reset at midnight via a localStorage date check.
Day Reset Time
The Day resets at (UTC hour) field sets when a new trading day begins. Default is 0 (midnight UTC). Change it to match your local trading schedule — for example, set 8 if you start each day at 08:00 UTC.
- A live countdown "Resets in Xh XXm XXs" updates every second in the panel
- At the reset hour, daily P&L, peak P&L, and the halt state clear automatically
- The chosen hour persists across page reloads via localStorage
- Sessions that span the reset boundary are attributed to the correct day
Suggested values for a $100 account
| Control | Suggested value | Why |
|---|---|---|
| Daily Stop Loss | $30 | 2× per-session SL of $15 — two bad sessions max |
| Daily Take Profit | $16 | 2× per-session TP of $8 — two strong sessions then stop |
| Profit Protection | $8 | Never give back more than $8 from the daily peak |
Scanner Settings
| Setting | Default | Why |
|---|---|---|
| Lookback | 100 | Matches DCircles sample size exactly. At 1,000 ticks each digit converges to ~10% in a flat market, giving reliable parity and strength readings. Lower values produce noisy distributions that diverge from DCircles. |
| Parity threshold | 51% | 51% is just above the 50% break-even line — qualifies more windows while still requiring the dominant side to have a measurable edge. Tighter thresholds miss too many profitable signals. |
| Digit strength | 10.5% | Baseline is 10% (uniform random). 10.5% is a low bar that keeps signal frequency high while still filtering out perfectly flat distributions. |
| Min qualifying | 2 | Requiring 2 digits above strength threshold ensures at least a mild skew exists before trading. Reduces missed signals compared to 3 while still filtering flat distributions. |
Risk Calculator
Accessed via the ⚠ Risk calc button next to Trade Side in the sidebar.
How to use
- Enter your Account Balance
- Adjust Martingale ×, Runs, and Max risk % if needed (defaults are recommended)
- The Recommended Stake is calculated automatically
- The breakdown shows each run's stake and cumulative exposure
- Stop Loss and Take Profit are derived from the worst-case total
- Click Apply to settings — updates stake, martingale, runs, SL, and TP at once
The math
Worst-case factor = 1 + mult + mult² + mult³ + ... + mult^(runs-1)
Recommended stake = (balance × risk%) ÷ factor [min $0.35]
Stop Loss = ceil(worst-case total)
Take Profit = ceil(worst-case total × 0.5)
Colour coding
| Colour | Meaning |
|---|---|
| Green | Worst-case ≤ 12% of balance — safe |
| Amber | Worst-case 12–22% of balance — moderate risk |
| Red | Worst-case > 22% — reduce stake or runs |
Session Management
A session is one complete trading cycle: pre-fill → watch for signal → trade → end.
└─► Pre-fill scanner (collect Lookback ticks)
└─► Session opens — watching for signal
└─► Signal fires → trade placed
├─► Win → reset stake → watch for next signal
├─► Loss → multiply stake → watch for next signal
└─► Runs exhausted / TP hit / SL hit → session ends
└─► Break (configurable) → new session opens
Trade watchdog
Every contract has a 15-second watchdog timer. If the contract result does not arrive (WebSocket drop, server delay), the bot logs a warning, marks the contract as ignored, and resets — preventing it from freezing indefinitely. If the result arrives late after the watchdog has already fired, it is silently discarded to prevent double-counting.
Session break
A corner toast shows the countdown and a Skip break button. The same button appears in the Current Trade panel. The break is non-blocking — you can adjust settings, review the log, or monitor the scanner during it.
Activity Log
Records every event in real time. Newest entries appear at the top.
| Colour | Type |
|---|---|
| Cyan | Info — signals, trade details, connections |
| Green | Win |
| Red | Loss |
| Amber | Warning — watchdog triggers, errors |
| Grey | System messages |
Click Export to download the log as DerBinAlpha_log_DD-MM-YYYY_HH-MM-SS.txt (oldest first).
Recommended Settings by Balance
Derived using 10% max risk, ×2.2 martingale, 5 protection runs. These are the same values the Risk Calculator and Dynamic mode produce. Use Dynamic mode to have these applied automatically as your balance changes.
| Balance | Stake | Martingale | Runs | Stop Loss | Take Profit |
|---|---|---|---|---|---|
| $100 | $0.35 | ×2.2 | 5 | $15 | $8 |
| $200 | $0.47 | ×2.2 | 5 | $20 | $10 |
| $500 | $1.18 | ×2.2 | 5 | $50 | $25 |
| $1,000 | $2.37 | ×2.2 | 5 | $100 | $50 |
| $2,000 | $4.74 | ×2.2 | 5 | $200 | $100 |
Best Practices
| Do | Don't |
|---|---|
| Use Legacy mode with 0% markup | Set parity threshold below 51% |
| Enable Dynamic mode — let stake scale with your balance | Set Stop Loss below worst-case session exposure |
| Test settings on Demo before switching to Live | Reduce lookback below 1,000 — lower values diverge from DCircles |
| Export the activity log after each session | Leave the bot unmonitored overnight |
| Keep screen on (Android) — tap Start to activate Wake Lock | Trade during major economic news events |
| Install as PWA for a cleaner, app-like experience | Run on iOS with screen auto-lock on — connection will drop |
FAQ
Why are Volatility Indices available 24/7?
They are computer-generated synthetic markets — not tied to any real exchange. Deriv runs them continuously using a certified random number generator.
Is there a best time to trade?
For Volatility Indices, no — the RNG doesn't change behaviour by time of day. The best time is when you are alert and available to monitor. Avoid trading when fatigued.
Why does my friend's account lose while mine profits on the same bot?
Check App ID markup. Even on demo accounts, Deriv's pricing engine applies markup to payout calculations. Any markup above 0% directly reduces winning payouts and can tip the strategy from profitable to losing.
Can I use the same API key for both Live and Demo?
No — each token is tied to one account. In Legacy mode, DerBinAlpha automatically detects both accounts from the authorize response and offers a one-click Live/Demo toggle in the topbar.
The trade shows "In progress..." for more than a few seconds — is something wrong?
The watchdog timer resolves this automatically within 15 seconds. Digit contracts on 1s markets normally settle in 1–2 seconds. Extended "In progress" can happen during high server load or a WebSocket delay — the bot recovers, marks the contract ignored, and continues. If a buy error occurs (e.g. stake exceeds market maximum), the trade is also cleared immediately and the panel shows "Buy failed — waiting for next signal".
What does HOT/COLD mean?
HOT is the digit with the highest frequency in the current 1,000-tick window. COLD is the least frequent. Since v1.8.0, the HOT digit for the qualifying side (ODD or EVEN) is the entry trigger — the bot waits for the scanner cursor to land on that specific digit before placing each trade.
Should I exclude certain digits?
The Digit Selection panel lets you exclude digits from triggering entries. Only exclude if you have a specific reason — by default all 10 digits are active and all contribute to signal evaluation.
Changelog
- Auto-resume: bot restarts automatically after an unexpected disconnect — no manual Start required
- Reconnect uses the token active at drop time — Demo/Live account is preserved across reconnects
- Linked alt-account token no longer cleared on auto-reconnect
- ODD/EVEN signal: both sides evaluated independently — stronger hot-digit percentage wins instead of ODD always taking priority
- Fixed: Legacy/PAT token cross-contamination — Legacy reconnect no longer picks up a PAT token written by API Key mode (and vice versa)
- Fixed: API Key mode now sends
underlying_symbolin proposals — resolves "Properties not allowed: symbol" errors on custom App IDs
- Fixed: Demo/Live toggle now appears in API Key mode after connecting
- API Key mode account switching: Live↔Demo triggers the full OTP flow with the target PAT
- Fixed: Demo account misclassified as Live — Deriv REST returns
"demo"not"virtual" - Alt-account section in API Key mode prompts for a PAT from developers.deriv.com
- Fixed: primary token never saved —
account_listomits tokens; captured viapendingConnectTokenbefore authorize response - Fixed: race condition on account switch — old WS close event fired after
connect()re-enabled auto-reconnect
- Fixed: Demo→Live switch now instant — Deriv silently drops re-authorize on an existing connection; app now disconnects and reconnects with the target token (~1s)
- Fixed: account switch looping on Demo — single
dba_alt_tokenkey was ambiguous after switching; replaced with typeddba_live_token/dba_demo_tokenkeys
- Demo/Live segmented toggle added directly in Connection panel — visible in both Legacy and API Key modes
- Active account highlighted (amber = Demo, green = Live); clicking an unavailable account prompts for token inline
- Fixed: accordion content clipped on mobile — sidebar flex-shrink was compressing cards; all options now fully visible with scroll
- Mobile accordion padding, touch targets, and single-column form grid improvements
- Removed accordion pinning — one accordion open at a time; tapping a header closes the current and opens the selected one
- Fixed: Excel export now includes row colors — replaced
xlsxwithxlsx-js-style(free fork that honours cell styles)
- Light/dark theme toggle — sun/moon button in topbar; preference saved across sessions
- Export activity log to Excel — color-coded rows (green = win, red = loss, amber = signal/system)
- Multi-mode trade side — Even, Odd, Under 4/6/8 selectable simultaneously as checkboxes; first qualifying signal across all active modes fires the trade
- Fixed: lookback window inconsistency —
processTickandfetchTicksHistorynow both default to 1000 ticks; 5000-tick max cap enforced
- WebSocket keepalive ping every 25s — prevents Deriv idle timeout mid-session
- Auto-reconnect on unexpected disconnect — reconnects within 3s; stops cleanly on manual disconnect
- Asset locked during active session — market dropdown reverts and warns if changed while the bot is running
- Fixed: scanner cursor invisible on hot digit — last-tick highlight restored
- Fixed: API Key mode now correctly shows Demo/Live badge and alt-token section immediately on connect
- Fixed: removed invalid
underlying_symbolfield from proposal payload (was causing trade errors in API Key mode)
- Alt-account linking instructions are now mode-aware — API Key users and Legacy users see different guidance
- Live/Demo account switching — link your alternate account token in the Connection panel to enable one-tap switching
- Account badge shows switch target (e.g. "Demo → Live") and is clickable
- Fixed: day-key month was 0-indexed (Jan showed as 0) — now correctly 1–12
- Fixed: duplicate tick/balance subscriptions on account switch
- Daily P&L, peak, and halt state persist across page reloads
- New contract modes: Under 4, Under 6, Under 8
- Under 4: enters when all four digits 0–3 exceed strength threshold; fires on any 0–3 tick
- Under 6: enters when digits 6–9 all drop below 10%; fires on 7, 8, or 9
- Under 8: enters when digits 7–9 are stable; fires on 2 consecutive 7/8/9 ticks
- Amber scanner highlight for UNDER trigger digits; signal panel shows live qualifying status
- Trade settings persist across page reloads — all fields saved automatically
- "Reset to capital defaults" button recalculates from live balance in one click
- Daily P/L, peak, and halt state persist across page reloads
- Fixed: proposal failure no longer locks the bot permanently
- Fixed: stale proposal can no longer execute a buy in the wrong session
- Ghost
proposal_open_contractsubscriptions cancelled on every trade settle, timeout, and bot stop
- Fixed: duplicate trade settlement — Deriv can deliver two
is_sold=1WebSocket frames for a fast-settling contract;onTradeClosenow rejects any call where the contract ID no longer matches the active trade, preventing double P/L accounting and double martingale progression - Fixed: session crash-loop —
endSessionfiring twice (caused by the above) would create twosetIntervalbreak timers; the second overwroteS.breakTimerwithout clearing the first, leaving an orphaned interval that calledopenSession()every second indefinitely (Sessions 5–30 cascade). Fixed by callingclearInterval(S.breakTimer)at the top ofstartBreak
- Dynamic mode now uses $100 stepped tiers — settings only change when balance crosses a $100 boundary, not on every trade
- Minimum tier is $100 (floor) — accounts below $100 receive $100-tier settings
- Log now shows tier and live balance:
⚡ Dynamic tier $200 (Bal $213.40) → Stake $0.47 | SL $20 | TP $10 - No-op guard added — recalculation skipped entirely if tier has not changed since last update
- Fixed topbar row 3 (account info) not displaying on mobile after header rewrite
- Mobile header restructured into 3 fixed rows: logo left / version right, controls row, account info row
- Logo wordmark and version no longer stack — version pushed to right with margin-left auto
- Controls row (Settings, ?, Sound, Status) distributed with space-between
- Default trade settings recalibrated to $100 account (Risk Calc: ×2.2, 5 runs, 10% risk)
- Stake / Initial Stake default: $3.00 → $0.35 · Take Profit: $50 → $8 · Stop Loss: $30 → $15
- Risk Calculator default balance: $500 → $100
- Dynamic Settings toggle in Trade Settings header — auto-recalculates stake/SL/TP from live balance after every trade; fields go read-only; persists via localStorage
- Fixed 2-row mobile header (logo + controls) — position fixed, no longer scrolls away
- Bottom stats bar slimmed to Win rate / Day P&L / Total P&L only
- App content padded to not hide under fixed header or bottom bar
- Mobile floating info bar (fixed bottom) — shows account badge, name, ID, balance, live price, win rate, day P&L, total P&L at all times
- Wake Lock API — tapping Start requests a screen wake lock to keep Android screen on while bot runs; released on Stop
- Wake lock auto-reacquires if tab regains focus while bot is still running
- All sidebar accordion panels collapse by default when Settings overlay opens on mobile
- Eliminated horizontal scroll on mobile — overflow-x hidden on html/body/app, ticker self-contained, log entries wrap
- Mobile responsive layout — breakpoints at 640px and 480px
- Sidebar hidden by default on mobile; toggled via ⚙ Settings button in topbar
- Topbar non-essential items hidden on mobile (balance, account info, P&L strip) — data shown in bottom bar instead
- Modal widths capped at 92vw — no overflow on narrow screens
- Form grid collapses to single column below 480px
- PWA: manifest.json, service worker (network-first, cache fallback), app icons
- Netlify deployment with root redirect to DerBinAlpha.html
- Configurable daily reset time — set any UTC hour (0–23) as your trading day boundary
- Live countdown to next reset displayed in Daily risk controls panel, updates every second
- UTC-aware day key — boundary correctly handles sessions that span the reset hour
- Reset hour persists across page refreshes via localStorage
- Daily stop loss — halts all trading for the day when cumulative losses exceed the limit
- Daily take profit — stops trading for the day once cumulative gains reach the target
- Profit protection — trailing stop on daily peak P&L; prevents giving back gains across sessions
- Daily P/L visible in topbar (Day column) and in the Daily risk controls panel
- Daily stats auto-reset at midnight via localStorage date check
- Fixed: digit 0 always showing 0% — prices now formatted with pip_size before digit extraction
- Fixed: ODD/EVEN percentages now match DCircles (root cause was digit 0 bug)
- Fixed: EVEN trades now fire correctly when parity conditions are met
- Fixed: entry now gates on HOT digit tick — bot waits for scanner to land on target before buying
- Fixed: reconnect no longer causes uncontrolled trading — full state reset on WebSocket close
- Lookback default and max raised to 1,000 to match DCircles sample size
- Fixed: buy error no longer leaves trade stuck in "In progress..."
- Watchdog extended 5s → 15s to handle slow contract settlement
- Late contract results after watchdog fire are discarded — no double-counting
- Scanner cursor flash extended to 900ms for smoother digit tracking
- Aggressive defaults seeded: Stake $3, Runs 30, TP $50, Break 30s, Parity 51%, Strength 10.5%, Min qualifying 2
- Risk calculator drives Stop Loss and Take Profit
- Apply to settings updates all 5 fields at once
- Empty balance field shows prompt instead of phantom values
- Risk calculator popup — balance in, stake auto-calculated
- $500 recommended settings seeded as defaults
- Scanner thresholds tightened (parity 54%, strength 14%, lookback 100)
- HOT/COLD digit highlighting on live scanner
- Live price display in topbar
- Trading status dot blinks green
- Session break changed to non-blocking corner toast with Skip button
- 5-second trade watchdog — auto-recovers hung contracts
- API credentials persist across page reloads
- Market symbols corrected (1HZ75V vs R_75)
- Live/Demo account switcher (Legacy mode)
- Activity log newest-first order fixed
- Scanner cursor speed matched to reference
- Initial release — live scanner, martingale engine
- Legacy + PAT connection modes
- Session management with break timer