PriceStatus

View as Markdown

Definition

Indicates the current status of the price feed of the primary data connection

Syntax

\<connection\>.PriceStatus

Examples

1private int priceLost;
2private int mainLost;
3
4private void OnAccountItemUpdate(object sender, AccountItemEventArgs e)
5{
6 // Count the number of times OnAccountItemUpdate() is called with a lost price connection
7 if (myAccount.Connection.PriceStatus == ConnectionStatus.ConnectionLost)
8 priceLost += 1;
9
10 // Count the number of times OnAccountItemUpdate() is called with a lost primary connection
11 if (myAccount.Connection.Status == ConnectionStatus.ConnectionLost)
12 mainLost += 1;
13
14 // Print the number of times each connection was lost during OnAccountItemUpdate()
15 if (mainLost > 0 || priceLost > 0)
16 Print(String.Format("Main connection lost {0} times. Price feed lost {1} times.", mainLost, priceLost));
17
18}