Trading: Data Cloud + Broker

Get a Datafye Data Cloud with broker connectivity running in under 5 minutes. Connect your algos to synthetic market data and Alpaca paper trading.

What you'll have:

  • Data Cloud with synthetic market data

  • Broker Connector configured for Alpaca paper trading

  • Your algo trading on paper account

Prerequisites:

  • Docker Desktop installed and running

  • 8GB+ RAM available

  • Alpaca paper trading account (free - sign up here)

  • Python 3.7+ (optional - for testing)

Windows users: You need WSL to install the CLI. Click here for instructions

Setting up WSL for Windows

If you don't already have WSL installed, follow these steps:

  1. Install WSL: Open PowerShell or Windows Command Prompt in administrator mode and run:

    wsl --install

    This will install Ubuntu by default.

  2. Restart your computer when prompted

  3. Launch WSL: Open the Start menu, search for "Ubuntu" (or your chosen Linux distribution), and click to launch

  4. Complete initial setup: Create a username and password when prompted

Once WSL is installed and running, continue with the installation instructions below (WSL provides a Linux environment, so follow the Linux instructions).

For more details, see Microsoft's WSL installation guide.

Tip: Consider using Windows Terminal for a better terminal experience.

Step 1: Install the Datafye CLI

curl -fsSL https://downloads.n5corp.com/datafye/cli/latest/install.sh | sudo bash

Verify installation:

Expected output:

No sudo access? See CLI Installation for alternative installation methods.

Step 2: Get Alpaca Credentials

  1. Sign up for a free Alpaca paper trading account at alpaca.markets

  2. Navigate to your paper trading dashboard

  3. Copy your API Key ID and Secret Key

Set as environment variables:

Step 3: Download Deployment Descriptor

This descriptor configures:

  • Synthetic dataset with 10 symbols:

    • Tech: AAPL, MSFT, GOOGL, AMZN, NVDA

    • Growth: TSLA, META, NFLX, AMD, INTC

  • Trades and quotes (tick data)

  • 1-minute OHLC bars

  • 90 days of historical data

  • Alpaca Broker Connector (paper trading mode)

  • No additional API keys required (besides Alpaca)

Step 4: Provision the Environment

Expected Output (when available):

Provisioning takes 3-5 minutes.

What Just Happened?

The deployment descriptor configured:

  • Data Cloud - Normalized market data service with REST and WebSocket APIs

  • Broker Connector - Integration with Alpaca for paper trading

  • Synthetic Dataset - 10 symbols with 90 days of historical data:

    • Tech: AAPL, MSFT, GOOGL, AMZN, NVDA

    • Growth: TSLA, META, NFLX, AMD, INTC

  • Data Types - Trades, quotes, and 1-minute OHLC bars

What's running:

  • Data Cloud container at http://localhost:8080

  • Broker Connector container at http://localhost:8082

  • Connected to your Alpaca paper trading account

  • Ready to accept trading algos that consume data and place orders

Step 5: Verify Services

Output:

Option B: CLI Commands

Step 6: Run Paper Trading Algo

Download and run the example paper trading algo:

Output:

Your algo is now paper trading through Alpaca!

Monitor Your Trades

Manage Your Deployment

Next Steps

Build custom trading algos:

Understand broker integration:

Add backtesting:

Move to live trading:

Troubleshooting

Docker not running: Start Docker Desktop and retry.

Broker connection failed: Verify your ALPACA_API_KEY and ALPACA_SECRET_KEY environment variables are set correctly.

Port conflicts: Stop conflicting services or see CLI Reference for custom ports.

Order rejected: Check your Alpaca account status and ensure paper trading is enabled.

Last updated: 2025-01-23

Last updated