An instance of this class serves as an intermediary between a trading strategy and the target order execution system. Botmain supports two types of order executions: Backtesting and Real-Time Trading.
The Backtesting order execution system is realized as the internal Botmain software component named OrderSimulator.
In Real-Time Trading mode, the order execution system is a part of a certain external trading platform provided by an exchange. Botmain in this case only controls the connection to this platform.
Properties
Name
Type
Description
isSimulation
boolean
Identifies the current working mode of OrderProcessor - Backtesting (Simulation) or Real-Time trading.
Methods
cancelOrder()
Sends a request to cancel the order with the given ID.
the instrument or portfolio name to cancel orders for
Returns
void
cancelReplaceOrder()
Sends a request to replace the original order with a new one. The original order is canceled, and new one (specified by replacementOrder) comes into effect. This conforms to the following rules:
If the replacement is successful, the original order receives a status of Canceled and new one becomes Submitted.
If the replacement fails, the original order remains in its current state, and the new one is rejected.