API Documentation

Connect to Paper Broker using the Python API client and trade via the FIX 4.4 protocol

FIX Protocol Connection

Paper Broker uses QuickFIX with the FIX 4.4 protocol standard for reliable, low-latency trading connections. FIX (Financial Information eXchange) is the industry-standard messaging protocol used by financial institutions worldwide.

What is FIX 4.4?

FIX 4.4 is a widely adopted version of the FIX protocol that provides:

  • Standardized messaging for order entry, execution reports, and market data
  • Session management with logon, logout, and heartbeat mechanisms
  • Message validation and error handling
  • High reliability with message sequencing and recovery
  • Flexibility to support various order types and trading scenarios
Learn More About FIX 4.4

We strongly encourage you to read the official FIX 4.4 specification to understand the protocol in depth. This will help you use the API more effectively and troubleshoot any issues.

FIX Connection Guide & Debugging

Comprehensive guide covering connection sequence, reading FIX messages, important debug fields, common issues, and real-world best practices.

Using the Python client? You can skip this section — it's for deeper FIX protocol understanding and debugging.

Python API Client

The PaperBrokerClient provides an event-based interface to interact with the Paper Broker system. It handles FIX session management, order placement, and market data subscription.

Full API Documentation

This wrapper API is designed to help you get started quickly without dealing with low-level FIX protocol details. For comprehensive API reference, configuration options, and advanced usage patterns:

Installation

# Install from downloaded wheel
pip install paperbroker_client-0.2.2-py3-none-any.whl

Quick Start

from paperbroker.client import PaperBrokerClient

# Create client with connection parameters
client = PaperBrokerClient(
    default_sub_account="D1",
    username="your_username",
    password="your_password",
    rest_base_url="http://localhost:9090",
    socket_connect_host="localhost",
    socket_connect_port=5001,
    sender_comp_id="your-FIX",
    target_comp_id="SERVER",
)

# Subscribe to events
client.on("fix:logon", lambda session_id, **kw: print(f"✅ Logged in: {session_id}"))

# Connect to FIX server
client.connect()

# Wait for logon
if client.wait_until_logged_on(timeout=10):
    # Get account info
    cash = client.get_cash_balance()
    print(f"💰 Available: {cash.get('remainCash', 0):,.0f} VND")

Additional Resources

Explore these resources to learn more about FIX protocol: