Connection
Definition
The Connection class can be used to monitor connection related events as well as accessing connection related information.
The Connection class can be used to monitor connection related events as well as accessing connection related information.
| Method | Description |
|---|---|
| CancelAllOrders() | Cancels all orders |
| Connect() | Connects to a connection |
| ConnectionStatusUpdate | Event handler for connection status updates |
| Property | Description |
|---|---|
| Accounts | List of accounts from the connection |
| Disconnect() | Disconnects from the connection |
| Options | The connection’s configuration options |
| PriceStatus | A ConnectionStatus representing the status of the price feed. Possible values are: • ConnectionStatus.Connected • ConnectionStatus.Connecting • ConnectionStatus.ConnectionLost • ConnectionStatus.Disconnecting • ConnectionStatus.Disconnected |
| Status | A ConnectionStatus representing the status of the order feed. Possible values are: • ConnectionStatus.Connected • ConnectionStatus.Connecting • ConnectionStatus.ConnectionLost • ConnectionStatus.Disconnecting • ConnectionStatus.Disconnected |
1 // Example of accessing information on all connected connections 2 public class MyAddOnTab : NTTabPage 3 { 4 public MyAddOnTab() 5 { 6 // Print information about all connected connections 7 lock (Connection.Connections) 8 foreach(Connection c in Connection.Connections) 9 NinjaTrader.Code.Output.Process(string.Format("Connection: {0} Provider: {1}", c.Options.Name, c.Options.Provider), PrintTo.OutputTab1); 10 11 // Other required NTTabPage members left out for demonstration purposes. Be sure to add them in your own code. 12 } 13 }