Skip to content

Live Trading

Live trading is straight forward, and it involves the following steps:

  1. Get libraries and build your C++ code.
  2. Setup runtime environments (Please read Quick Start for details).
  3. Create a json configuration file.
  4. Start the trading application. The live trading application shipped with the SDK is ccc_fast_trader. You can also write and build your own application.

    ccc_fast_trader YOUR_CONFIG_FILE_PATH live
    

  5. Send a resume command:

    • If your Algo strategies directly inherit from class Strategy, they start trading immediately.
    • If your Algo strategies inherit from CCBaseStrategy or CCModelStrategy, they will stay at pause state. You need send a resume command using our command line tool ccc_send_cmd.py
      ccc_send_cmd.py -c '{"instance": ".*", "action": "resume"}'
      

    Info

    The python scripts mentioned here (ccc_send_cmd.py and ccc_stats.py) will be released in the next version.

  6. Monitor trading:

    • If your Algo strategies directly inherit from class Strategy, you need create your own way to monitor them.
    • If your Algo strategies inherit from CCBaseStrategy or CCModelStrategy, you can run trading monitor tool ccc_stats.py in the SDK to monitor them. It is a small python file. and you can customize it easily.
      ccc_stats.py
      
  7. Manually control trading:

    • If your Algo strategies directly inherit from class Strategy, please create your own control mechanism.
    • If your Algo strategies inherit from CCModelStrategy, You can send one of the following commands using our command line tool ccc_send_cmd.py:
      • resume: resume trading
      • pause: close open orders and pause trading
      • liq_only: trade on position decreasing direction only.
        ccc_send_cmd.py -c '{"instance": ".*", "action": "pause"}'
        
  8. Post trade analysis:

    • If your Algo strategies directly inherit from class Strategy, please manage your own order/trade log.
    • If your Algo strategies inherit from BaseStrategy or its subclasses, order log and trade log will be stored in a subdirectory under the log_path of instance configration.