This project is a plugin for the Zorro Automated Trading System, integrating with Rithmic's R | API+ to provide market data and trading capabilities.
To install the plugin, follow these steps:
- Download the latest release from the releases page.
- Unzip the downloaded file.
- Copy the
rithmic.dll
from rithmic_zorro_plugin.zip into theplugin
folder under Zorro's root path. - Copy the
rithmic.dll
from rithmic_zorro_plugin64.zip intoplugin64
folder under Zorro's root path. - Copy the
rithmic_ssl_cert_auth_params and rithmic.bin
into Zorro's root path.
To use the plugin, follow these steps:
- Open Zorro, select Rithmic as the broker.
- Enter the Your Rithmic User ID in the User ID input box.
- Enter the Your Rithmic Password in the Password input box.
- Click the Trade button to run your script, select the Rithmic Server and Gateay in the Rithmic Login Dialog.
The plugin is configured via the Zorro.ini
or ZorroFix.ini
file (preferred). Bellow are the plugin specific configurations:
RithmicLogLevel=2 // Optional. 0=TRACE, 1=DEBUG, 2=INFO, 3=WARNING, 4=ERROR, 5=CRITICAL, 6=OFF Default to 2(INFO).
RithmicLogLevel: Sets the plugin's logging level. Default to INFO (2).
In the assets.csv, there must be a Symbol
column which has .<exchange>
at the end of an asset. For example:
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Market,Multiplier,Commission,Symbol
ESH5,5993.75,0.25,0.0,0.0,0.25000,0.0100000,-98.7,0,1.00,0.0,*.CME
Following Zorro Broker API functions have been implemented:
-
BrokerOpen
-
BrokerLogin
-
BrokerAsset
- Only support Balance
-
BrokerHistory2
-
BrokerBuy2
-
BrokerTrade
- Only output pOpen, the average fill price.
-
BrokerCommand
- GET_COMPLIANCE
- GET_BROKERZONE
- GET_MAXTICKS
- GET_POSITION
// The Symbol needs to be in <Asset>.<Exchange> format brokerCommand(GET_POSITION, "ESH5.CME");
- GET_AVGENTRY
- SET_ORDERTEXT
- SET_SYMBOL
- SET_ORDERTYPE (0:IOC, 1:FOK, 2:GTC)
- SET_WAIT
- GET_PRICETYPE
- SET_PRICETYPE
- SET_AMOUNT
- SET_DIAGNOSTICS
- SET_LIMIT
- DO_CANCEL
- GET_VOLTYPE
Plugin specific commands:
- 2000: Set logging level
brokerCommand(2000, loging_level); // Valid logging levels are: // 0: TRACE // 1: DEBUG // 2: INFO // 3: WARNING // 4: ERROR // 5: CRITICAL // 6: OFF
- 2001: Override default order type to DAY. This command has no effect if GTC order is used.
brokerCommand(2001, 1 or 0); // 1: Use Day order type // 0: Use default order type, IOC
- CMake 3.16 or higher
- Visual Studio
- Rithmic API SDK
- Zorro Trading Platform
Rithimic Zorro Plugin relies on several external libraries. You can install these dependencies using vcpkg. Follow these steps to install the required libraries:
-
Install vcpkg:
git clone https://github.com/microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh
-
Install Required Libraries:
./vcpkg install spdlog ./vcpkg install date
-
Integrate vcpkg with CMake: Add the following line to your CMake configuration to use vcpkg:
cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
-
Clone the repository:
git clone https://github.com/yourusername/rithmic_zorro_plugin.git cd rithmic_zorro_plugin
-
Set the environment variables for the Rithmic API SDK:
set RITHMIC_API_INCLUDE_DIR=path/to/rithmic/include set RITHMIC_API_LIB_DIR=path/to/rithmic/lib
If using VSCode, these variables can also be set in setting.json under .vscode folder
"cmake.configureEnvironment": { "RITHMIC_API_INCLUDE_DIR": "<path to RApiPlus include directory>", "RITHMIC_API_LIB_DIR": "<path to RApiPlus lib directory>", "ZORRO_ROOT": "<Path to Zorro root directory>" }
-
Run CMake:
cmake -S . -B ./build
-
Build the project:
cmake --build ./build --config Release
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.