How to develop an External Connection |
ArthaChitra allow users to develop their own connection. The External Connection can be used for both order submission and appending data (real-time and historical).
The external connection has 3 (three) parts namely:
The configuration properties/parameters of the connection is defined in the the ExternalOptionsBase script. User can configure the parameters by designing xaml templates which we will discuss in the next section.
For more details please refer to the ExternalOptionsBase class definition.
Note: The ConnectionType of an External Options is set to ConnectionType.Live
The ExternalAdapterBase defines the properties and methods which actually pulls data or submits orders etc. Which connection is associated with the ExternalOptionsBase class is defines by the property Type.
For more details please refer to the ExternalAdapterBase class.
Note: Most of the methods of the ExternalAdapterBase class are asynchronous. If you consider to await then please set ConfigureAwait to false. The below code futher demonstrates it.
public override async Task PlaceOrderAsync(OrderBase[] orders) { await CustomMethodAsync().ConfigureAwait(false); //Note: ConfigureAwait is set to false } private async Task CustomMethodAsync() { //more codes }