OnConnectionStatusUpdate()

View as Markdown

Definition

An event driven method used which is called for every change in connection status.

Method Return Value

This method does not return a value.

Syntax

You must override the method in your indicator with the following syntax:

protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)

Method Parameters

ParameterDescription
connectionStatusUpdateA ConnectionStatusEventArgs object representing the most recent update in connection.
StatusRepresents the status of the key adapter functionality. If the adapter supports live orders it will set Status to Disconnected when its order system is not connected.
PriceStatusRepresents the status of the price feed.

Examples

1protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
2{
3 if(connectionStatusUpdate.Status == ConnectionStatus.Connected)
4 {
5 Print("Connected for orders at " + DateTime.Now);
6 }
7
8 else if(connectionStatusUpdate.Status == ConnectionStatus.ConnectionLost)
9 {
10 Print("Connection for orders lost at: " + DateTime.Now);
11 }
12}
1protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
2
3{
4
5 if(connectionStatusUpdate.PriceStatus == ConnectionStatus.Connected)
6
7 {
8
9 Print("Connected to price feed at " + DateTime.Now);
10
11 }
12
13 else if(connectionStatusUpdate.PriceStatus == ConnectionStatus.ConnectionLost)
14
15 {
16
17 Print("Connection to price feed lost at: " + DateTime.Now);
18
19 }
20
21}