Click or drag to resize

Transaction number

When working with orders the main identifier is OrderTransactionId, not OrderId. This is done because the OrderId generated by the exchange. Because of this, immediately after the execution the ConnectorRegisterOrder(Order) method, for some time the OrderId can not be initialized. Therefore, at once after the transaction sending, the trading program generates OrderTransactionId.

OrderTransactionId automatically generated by the IdGenerator class. This is an abstract class that has two standard implementations:

  • IncrementalIdGenerator - installed by default. It increases the number by 1. The initial value set through the IncrementalIdGenerator.Current, property, and by default, the value is equal to the number of milliseconds since the start of the day.
  • MillisecondIdGenerator. It generates the transaction number, which equal to the number of milliseconds from the time of generator creating.