Host Class

Main API class. This provides access to everything else.

Definition

Namespace: T4.API
Assembly: T4API.47 (in T4API.47.dll) Version: 4.7.0.0 (4.7.68.4)
C#
public class Host : IDisposable
Inheritance
Object    Host
Implements
IDisposable

Remarks

The Host is the center of the API. Nothing works without a Host object being created and logging in successfully to the server.

As soon as the Host object is created it will attempt to connect to the servers and login. It will remain connected to the servers until the Dispose method is called. If it is disconnected from the server due to a network problem then it will automatically keep trying to reconnect until disposed of.

Market information can be obtained using the MarketData property which also allows access to the exchange and contract hierarchy.

Account information, including positions, existing orders and submitting new orders can be obtained via the Accounts property.

Constructors

Host(APIServerType, String, String, String, String, String) Constructor that connects to the server, fails if cannot connect successfully. Connection and login is carried out asynchronously.
Host(APIServerType, String, String, String, String, String, String) Constructor that connects to the server, fails if cannot connect successfully. Connection and login is carried out asynchronously.

Properties

Accounts The list of accounts that this user has access to.
AppName Application Name
Brand Simple branding details for the firm.
Firm The Firm that this user belongs to.
FirmURL Return the firm specific url based on the login firm.
IncludeTestEnvironments Whether we are to include test environments in the login selection list. This property is for internal test purposes only.
IsConnected Whether the API is currently connected to the server or not.
MarketData Exchange, Contract and market information that this user has access to.
MasterUser The master user
NewVersion The latest version number of the software that is available.
NewVersionAvailable Return whether there is a new version available that is not compulsory.
NewVersionRequired Return whether there is a new version available that is compulsory.
NewVersionURL Return the url of the latest version install if we have one.
Server Whether the API is connected to the Live or Simulator systems.
ServerName The specific server we are connected to.
Users The list of users that have also been logged in.
Version The version number of this API instance.

Methods

ChangePassword Displays a dialog allowing the user to change their password.
Dispose Disconnects from the server and shuts down the API.
EnterLock Enter a lock to prevent simultaneous updates.
EnterLock(String) Enter a lock to prevent simultaneous updates.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExitLock Exit the lock.
ExitLock(String) Exit the lock.
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetOrderPull Get an order pull batch to cancel one or more orders for multiple accounts and markets.
GetOrderRevision Get an order revision batch to revise one or more orders for multiple accounts and markets.
GetOrderSubmission Get an order submission batch to submit one or more orders to multiple accounts and markets.
GetOrderSubmission(OrderLink) Get an order submission batch to submit one or more orders to multiple accounts and markets.
GetTypeGets the Type of the current instance.
(Inherited from Object)
Login(APIServerType, String, String) Displays a login dialog to the user that also handles password expiry and password changing. Returns a logged in Host object if successful or Nothing if the user cancels the dialog.
Login(APIServerType, String, String, Boolean) Displays a login dialog to the user that also handles password expiry and password changing. Returns a logged in Host object if successful or Nothing if the user cancels the dialog.
Login(String, String, Boolean, Boolean) Displays a login dialog to the user that also handles password expiry and password changing. Returns a logged in Host object if successful or Nothing if the user cancels the dialog.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
PullOrder(Order) Pulls the specified order.
PullOrder(Order, User, Boolean) Pulls the specified order.
RemoteTime Returns the approximate current time at the server. This should NOT be relied upon as being accurate.
RemoteTime(DateTime) Converts the specified local time into the equivalent approximate server time. This should NOT be relied upon as being accurate.
ReviseOrder(Order, Int32, NullableDecimal) Revises the specified order.
ReviseOrder(Order, Int32, NullableDecimal, NullableDecimal) Revises the specified order.
ReviseOrder(Order, Int32, NullableDecimal, NullableDecimal, NullableDecimal, ActivationData, Int32, User, Boolean) Revises the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, Int32, NullableDecimal) Submits the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, Int32, NullableDecimal, NullableDecimal, String) Submits the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, TimeType, Int32, NullableDecimal, NullableDecimal, String, NullableDecimal, ActivationType, ActivationData) Submits the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, TimeType, Int32, NullableDecimal, NullableDecimal, String, NullableDecimal, ActivationType, ActivationData, Int32, Int32) Submits the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, TimeType, Int32, NullableDecimal, NullableDecimal, String, NullableDecimal, ActivationType, ActivationData, Int32, Int32, User, Boolean) Submits the specified order.
SubmitOrder(Account, Market, BuySell, PriceType, TimeType, Int32, NullableDecimal, NullableDecimal, String, NullableDecimal, ActivationType, ActivationData, Int32, Int32, User, Boolean, Boolean) Submits the specified order.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Events

LoginResponse Event raised when login succeeds, fails or is lost due to disconnection.
Notification Event for text notifications from the server.

Fields

CurrencyData Reference to the currency rate list.
SyncRoot Synchronisation root.
TradeSummary Whether the API provides Trade Summary market and chart trade data or if it provides the breakdown of individual resting orders that took part in each trade.

See Also