Agent trading settings - Events
The Agent trading settings, as well as the Common settings, are available when creating a new agent. In addition, the Trading settings window can be opened by clicking on the gear icon in the Agent column.


Events are understood as operations of a broker or exchange with an order (during the execution of a transaction) or general events related to the program.
When one of the events occurs, a Single agent recalculation is executed. In the editor, you can use the Additional "Event" block. At this recalculation, if an event has occurred, the block will return True, which can be used in the algorithm. If there are many events in one agent at once, a single recalculation is performed. A lot at once - write a hardcode for 5ms. That is, if several events occurred within 5ms, the recalculation call will be single.
Event name
Order rejected
Broker (or exchange) rejected the order
Order filled
There have been transactions in the market that satisfy the entire volume requested in the order
Order canceled
While recalculating the agent, the script calculated that there was no signal, so the request must be canceled. The program issues a command to the broker. This event is the result of the "Order canceled" response from the broker.
Order quantity changed
In the Agent, during the main recalculation, the script calculated the change in the number of lots, which differs from the previous one.
Position opened
The signal is executed, the program received the numbers: Transaction, Order, Trades. All numbers are linked to the agent's signal through the portfolio number.
Position closed
Сигнал на закрытие позиции исполнен. Портфельный номер открытия позиции имеет исполненный портфельный номер закрытия позиции.
Trading is started
The status came from the exchange that the trades were opened. Most often, the program uses the first market trade. The start of trading is determined by the first quote of the current day, since it is almost always faster than the trading status sent by the exchange for the instrument.
Trading is stopped
The status came from the exchange that the trading was stopped.
Bar closed, not trades
The bar was closed by server time, but there are no new deals
Pretrade limitation
One of the Risk Management filters was triggered. (Trade - Risk Management)
Last modified 1mo ago
Copy link