Skip to content

pythonbottrader/deriv-bot-pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DerivBot Pro

AI-Powered Automated Trading Platform for Deriv.com

DerivBot Pro is an Android application that automates trading strategies on the Deriv platform. It features a built-in HTTP server (NanoHTTPD), machine learning models (TensorFlow.js via WebView), multi-contract support, and a rich WebView-based UI with real-time streaming via WebSocket.


Screenshots

Dashboard Trading Strategies
Dashboard Trading Strategies
Login Settings
Login Settings

Features

Trading Contracts

  • Rise / Fall — Predict whether the price will rise or fall
  • Under / Over — Predict digit above/below a barrier
  • Even / Odd — Predict even/odd digit
  • Match / Diff — Predict if digit repeats or changes
  • Asian Up / Down — Predict average above/below
  • Touch / No Touch — Predict if price touches a barrier

AI Strategies

  • Trend + ML — Momentum analysis combined with neural network
  • Technical Indicators — RSI, MACD, Bollinger Bands, Stochastic
  • Reversal — Entry against extreme movements
  • Frequency — Historical pattern-based analysis
  • Advanced ML + Patterns — Deep neural network with TensorFlow.js (128/64/32 architecture)
  • Continuous real-time model training and market adaptation

Risk Management

  • Configurable stake, duration (3-30 ticks/seconds/minutes/hours)
  • Smart Martingale (on/off)
  • Consecutive loss limit
  • Stop loss and stop win targets

Authentication

  • OAuth2 login with one click via Deriv
  • Manual API token alternative

Supported Markets

  • 23 synthetic indices:
    • Volatility 10, 25, 50, 75, 100
    • Boom 300, 500, 1000
    • Crash 300, 500, 1000
    • Basket indices
    • Crypto indices

Multi-language UI

  • English
  • Portuguese
  • Spanish

Architecture

Overview

┌─────────────────────────────────────┐
│         Android App (APK)           │
│  ┌───────────────────────────────┐  │
│  │      WebView (UI Layer)       │  │
│  │  (HTML/JS/CSS - assets/www/)  │  │
│  └──────────┬────────────────────┘  │
│             │ HTTP                  │
│  ┌──────────▼────────────────────┐  │
│  │   MiniHttpServer (NanoHTTPD)  │  │
│  │   - REST API (comments,       │  │
│  │     trades, users, license)   │  │
│  │   - Static file serving       │  │
│  └──────────┬────────────────────┘  │
│             │                       │
│  ┌──────────▼────────────────────┐  │
│  │    WebSocket (wss://          │  │
│  │    ws.derivws.com)            │  │
│  │    ↓ Direct Deriv API         │  │
│  └───────────────────────────────┘  │
│                                      │
│  ┌───────────────────────────────┐  │
│  │  BotService (Foreground)      │  │
│  │  - Keeps bot running in       │  │
│  │    background                 │  │
│  └───────────────────────────────┘  │
│                                      │
│  ┌───────────────────────────────┐  │
│  │  Start.io Ads (Banner)        │  │
│  └───────────────────────────────┘  │
└─────────────────────────────────────┘

Components

1. SplashActivity

  • Launch screen with 2-second delay
  • Transitions to MainActivity

2. MainActivity (WebView Container)

  • Embeds MiniHttpServer on port 8080
  • Loads WebView UI from http://127.0.0.1:8080
  • Renders banner ads via Start.io SDK
  • Starts BotService for background operation
  • Requests notification permission (Android 13+)

3. MiniHttpServer (NanoHTTPD-based REST API)

Serves the trading web application and provides REST endpoints:

Method Endpoint Description
GET /api/comments List comments
POST /api/comments Create comment
PUT /api/comments/:id Edit comment
DELETE /api/comments/:id Delete comment
POST /api/register Create account
POST /api/login Authenticate user
POST /api/forgot-password Reset password
POST /api/trades Record trade
GET /api/ranking Get user rankings
GET/POST/DELETE /api/license License management

4. BotService (Foreground Service)

  • Keeps the bot running in the background
  • Shows persistent notification: "DerivBot Pro — Robô rodando em segundo plano"

Data Storage

All user data is stored as JSON files in the app's internal storage (files/deriv_data/):

  • users.json — Registered users with SHA-512 hashed passwords
  • trades.json — Trade history (up to 5000 entries)
  • comments.json — User comments (up to 200 entries)
  • license.json — License key storage

Security

  • Passwords hashed with SHA-512 + 16-byte salt + 1000 iterations
  • CORS headers configured for API access
  • Static file serving restricted to known extensions only

Building the APK

Prerequisites

  • Android Studio Hedgehog (2023.1.1) or newer
  • JDK 17
  • Android SDK 34

Steps

# 1. Clone the repository
git clone https://github.com/pythonbottrader/deriv-bot-pro.git
cd deriv-bot-pro

# 2. Open in Android Studio
# File → Open → select android/ directory

# 3. Build
# Menu: Build → Make Project
# Or via Gradle:
cd android
./gradlew assembleDebug

# 4. The APK will be at:
# android/app/build/outputs/apk/debug/DerivBotPro-1.0.apk

Download

Download APK v1.0


Development

Project Structure

deriv-bot-pro/
├── android/                          # Android app source
│   ├── app/
│   │   ├── build.gradle.kts          # App-level build config
│   │   └── src/main/
│   │       ├── AndroidManifest.xml   # Permissions, activities, services
│   │       ├── assets/www/           # Web UI assets (HTML/JS/CSS)
│   │       ├── java/com/deriv/app/   # Java source code
│   │       │   ├── MainActivity.java # WebView + server host
│   │       │   ├── MiniHttpServer.java # Embedded HTTP server
│   │       │   ├── BotService.java   # Background service
│   │       │   └── SplashActivity.java # Splash screen
│   │       └── res/                  # Android resources
│   ├── build.gradle.kts              # Root build config
│   ├── gradle.properties             # Gradle properties
│   ├── settings.gradle.kts           # Project settings
│   └── app-ads.txt                   # Ads.txt for Start.io
├── apk/
│   └── DerivBotPro-1.0.apk           # Pre-built APK
├── img/                              # Screenshots
├── LICENSE
└── README.md

Technologies Used

Technology Purpose
Java 17 Android app logic
NanoHTTPD 2.3.1 Embedded HTTP server for REST API + static files
Android WebView UI rendering (WebView-based SPA)
Deriv WebSocket API Real-time trading via wss://ws.derivws.com
TensorFlow.js Machine learning models in WebView
Start.io SDK 5.2.5 In-app banner advertisements
Gson 2.10.1 JSON serialization/deserialization
SHA-512 + Salt Password hashing

License

This project is licensed under the MIT License — see the LICENSE file for details.


Disclaimer

Trading involves significant financial risk. This tool is provided for educational purposes only. Always test strategies on a demo account before trading with real funds. Past performance does not guarantee future results. The authors are not responsible for any financial losses incurred through the use of this software.

About

DerivBot Pro - AI-powered automated trading platform for Deriv.com. Android APK with embedded HTTP server, ML trading strategies, and WebSocket integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors