Live Trading
Live trading is straight forward, and it involves the following steps:
- Get libraries and build your C++ code.
- Setup runtime environments (Please read Quick Start for details).
- Create a json configuration file.
-
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
-
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.
-
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
-
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"}'
-
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.