Messages and subscriptions¶
The Messages
and MessageSubscription
interfaces provide types that enable communications between algorithms inside a cTrader instance. With these types, you can code one algo to send a message and other algos can subscribe to it.
Warning
Messages API objects work only in .NET 6 algorithms.
An algo can be coded to perform a specific action when a specific message is received from another algo. The messages and actions could be anything.
Example
Consider a plugin that generates signals and sends them to a cBot, which listens for messages and opens positions accordingly.
Send message (trade signal)¶
1 |
|
Take action (open position)¶
1 2 3 4 5 6 7 8 9 |
|