Event recalculations

Additional recalculations

Functionality is supported with enabled Recalculation Interval in "Interval (For Events)" script properties.

With other recalculation intervals, when an event occurs and there is a position, the position is not tied to the bar. Therefore, no orders will be placed that close the position inside the position entry bar.

When trading, sometimes you need to make an additional recalculation. Most often, this is required when you need to place a stop-loss on an opened position within the current bar. It is also required when working with multiple (two or more) instruments, for example, in arbitrage trading. Where the specificity is the simultaneous entry into multidirectional positions.

Event setup

Events can be configured in the agent's trading settings. Trading -> Autotrading Control Center -> Trade Settings

When one of the events occurs, a Single recalculation of the agent is performed. 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

List of Events

"Event" block

In the editor, you can additionally use the "Event" block.

On this recalculation, if an event occurred, the block will return true, this value can be used in the algorithm. If many* events arrive at once in one agent, a single recalculation is performed.

*A lot at once - 5ms hardcode. If several events occur within 5ms, the recalculation call will be single.

In the block, you can select an event from the drop-down list. The block can be used in the editor many times, the block is connected to the source, it sends an event to the instrument.

Last updated