MessageArgs
class cAlgo.API Since 5.2
DesktopCLICloud
Provides data for the message handler.
Definition
public class MessageArgs<TMessage>
Namespace: cAlgo.API · Group: Messages
Examples
protected override void OnStart()
{
Messages.Subscribe<string>("Signals", OnSignalReceived);
}
private void OnSignalReceived(MessageArgs<string> args)
{
Print("{0} from {1} on chart {2}: {3}", args.Subscription.Subject, args.SenderInstanceId, args.ChartId, args.Message);
}
# Not available in Python: MessageArgs is only received by handlers of the generic Messages.Subscribe method
Properties
| Name | Description |
|---|---|
ChartIdDesktopCLICloudstring | Gets message sender ChartId. ChartId is null for plugin sent messages. |
MessageDesktopCLICloudTMessage | Gets the message. |
SenderInstanceIdDesktopCLICloudstring | Gets message sender instance Id. |
SubscriptionDesktopCLICloudMessageSubscription | Gets message subscription. |