Client User Manual for Kungfu Quantitative Trading System

·

The Kungfu quantitative trading system is designed with a modular, user-friendly interface that offers flexibility and powerful functionality for traders across futures, stocks, and digital assets. This guide walks you through the core components of the client, including account setup, market data integration, strategy management, and advanced execution tools—all optimized for efficiency, precision, and real-time performance.

Whether you're managing multiple trading accounts, backtesting strategies, or executing large orders with minimal market impact, Kungfu’s modular architecture ensures seamless operation and intuitive control. Let’s dive into how to use each panel effectively.


Modular Interface Overview

Kungfu leverages a modular integration framework to deliver a flexible and visual trading experience. Functional modules are organized into dedicated panels, allowing users to customize layouts based on personal workflow preferences.

Each module supports independent operation and real-time adjustments. For example, the Position Panel dynamically updates based on your selection—showing holdings by strategy, account, or algorithm—for granular performance tracking.

This design enhances usability while supporting advanced statistical capabilities across trading processes.


Trading Account Management

The Trading Account Panel allows you to manage multiple brokerage connections, including CTP (futures), XTP (stocks), OKX (digital assets), Binance Futures, and simulated environments.

How to Add a Trading Account

  1. Click "Add" in the Trading Account Panel.
  2. Select your counter type:

    • CTP – Futures
    • XTP – Equities
    • OKX – Cryptocurrency (via OKX)
    • BinanceFuture – Binance Futures
    • Kungfu Sim – Simulation mode (uses random data)

👉 Maximize your crypto trading efficiency with advanced tools

Example: Adding an OKX Account

After selecting OKX as the counter:

FieldDescription
Account AliasOptional label for identification
UsernameYour OKX account name
PasswordLogin password
API KeyProvided in OKX API settings
Secret KeyUsed for secure authentication
Sync External OrdersEnables syncing orders from other platforms
Simulated TradingEnable for demo accounts only

Once configured, click "Confirm", then toggle the process switch to launch the account. When status shows "Ready", login is successful.

Note: Changes made while the account is running won’t take effect until you restart the process.

Account Operations


Market Data Source Configuration

Market data is pulled using the same credentials as your trading account. Ensure consistency between login details for seamless operation.

Adding a Market Data Feed

  1. Click "Add" in the Market Source Panel.
  2. Choose the matching counter (e.g., CTP, XTP, OKX).
  3. Enter required fields such as IP, port, and credentials.

Example: Configuring OKX Market Feed

OptionFunction
Enable Ticker PushStreams real-time price updates (memory-intensive)
Enable Transaction PushDelivers tick-level trade data
Enable Fee Rate PushUpdates fee structure in real time

Click "Confirm" to activate. Once the status turns "Ready", data streaming begins.

Warning: Disabling a market source may disrupt dependent strategies or algorithms relying on live quotes.

Strategy Process Panel

This panel acts as a strategy workspace where you can import .py files, edit code in real time, and monitor execution status.

Adding a Strategy

  1. Click "Add"
  2. Fill in:

    • Strategy ID – Unique identifier
    • Strategy Path – Local path to your .py file (must be on the same drive as Kungfu installation)

Ensure your trading (TD) and market data (MD) processes are ready before launching—otherwise, orders will fail.

Real-Time Code Editing

An embedded IDE lets you modify strategy logic instantly. Click "Edit", make changes, and save—the system auto-saves without interrupting operations.

Monitoring & Control


Backtesting & Replay Tools

Use the Replay Tool for post-session debugging and strategy validation using historical data.

Key Use Cases

To run a replay:

  1. Click "Replay" in the Strategy Panel
  2. Select session timeframe
  3. Review output logs to compare simulated vs actual behavior
Must enable matching engine when testing modified logic or fee scenarios.

Diagnostic Tool for Journal Analysis

Journal files store detailed event logs—including quotes, orders, and trades—ideal for deep-dive analysis.

Accessing Diagnostics

Click the eye icon next to any process → "Enter Visualization"

Features include:

You can also open diagnostics globally via File > Open Diagnostic Tool to analyze multi-process interactions.


Operator Panel: Boost Efficiency with Shared Calculations

Operators reduce redundant computation by enabling reusable data pipelines—ideal for high-cost operations like machine learning or K-line generation.

Two Types of Operators

Example: Creating a 5-Second Bar

ParameterValue
Bar IDUnique identifier (e.g., bar_5s)
Data Sourcee.g., sim or CTP
InstrumentsComma-separated list
Period5 seconds

This bar can then be subscribed to by multiple strategies, reducing CPU load.

👉 Access powerful trading APIs for custom algorithm development


Position & Order Tracking Panels

Position Panel

Displays real-time holdings with filtering and export options:

FieldDescription
Instrument CodeTicker + exchange
Long/ShortDirection
Yesterday / TodayBreakdown of holding age
Average Entry PriceCost basis
Floating PnLUnrealized profit/loss

Use selection filters to view positions per strategy or account.

Order Record Panel

Tracks all order activity with powerful utilities:

Real-time stats include average slippage, fill rate, and system/network latency.


Trade Task Automation

Automate complex executions using four built-in task types:

1. Conditional Orders

Trigger trades based on price or time conditions:

2. Excel-Based Orders

Upload CSV files for batch scheduling:

3. Iceberg Orders

Break large volumes into smaller chunks:

4. TWAP Algorithms

Distribute orders evenly over time:

Both support squeeze alerts and anti-gaming features like protection pricing.


Basket Trading: Multi-Instrument Execution

Ideal for portfolio rebalancing, arbitrage, or diversified investing.

Create a Basket

Choose:

Import via CSV template or add manually.

Execute with Smart Features

Monitor progress via:

Use Chase Order to replace pending orders at better prices during volatility.


Global Settings & Performance Optimization

Access via bottom-left gear icon or Ctrl + ,

System

Performance

Risk Controls


Frequently Asked Questions (FAQ)

Q: Can I use local Python libraries in my strategies?
A: Yes. Enable "Use Local Python" in Global Settings. Only Python 3.9.x is supported. Install the provided .whl file using pip.

Q: How do I recover today's orders after restarting?
A: Enable "Restore Today's Orders" during account setup. The system pulls open orders from the counter upon login.

Q: Why isn't my strategy placing trades?
A: Verify that both TD and MD processes are in "Ready" state. Also ensure operators—used in logic—are running if applicable.

Q: What does 'Sync External Orders' do?
A: Imports trades placed outside Kungfu into your order history ("System External" source), ensuring accurate position tracking.

Q: How can I reduce memory usage with OKX feeds?
A: Disable Ticker, Transaction, or Fee Rate pushes if not needed—they consume significant RAM due to high-frequency updates.

Q: Is there a way to test strategies without risking capital?
A: Use the built-in SimNow simulation counter (Kungfu Sim) with synthetic data for safe testing of logic and execution flow.


Core Keywords: algorithmic trading platform, quantitative trading system, automated order execution, strategy backtesting tool, multi-account trading interface, real-time market data integration, TWAP algorithm trading, basket trading automation