Gain Capital - AutoEx Trading API
Core Web services offered by GAIN Capital. These services are offered to customers of GAIN Capital for the purposes of carrying out business with GAIN Capital. All data supplied remains copyright GAIN Capital inc and may not be reproduced without the prior written permission of GAIN Capital inc. USAGE: The web functions have been developed with Microsoft .NET WebServices. Best results can be found when used with Visual Studio.NET. For further information, see http://api.efxnow.com/Docs
The following operations are supported. For a formal definition, please review the Service Description.
-
CancelOrder
Cancel trade order. OrderConfirmation as reference number provided for original order; note: in the case of an OCO, both legs should be cancelled. -
CancelOrderByOrderID
Cancel trade Order.Please provide Order Reference Number for the Reference Number. The Order Reference Number can be retrieved from GetOrderBlotterDataSet. All the legs of the Order will be removed. Please provide Order Reference Number for the Reference Number. All the legs of the Order will get removed. -
CancelOrderByReferenceNumber
Cancel trade Order. Please provide Order Reference Number for the Reference Number. All the legs of the Order will get removed. -
DealRequest
Place trade deal request.Here the function is intended to be used when you wish to enter the market at a specified rate. If the specified rate is the current market rate the request is processed else it will get rejected (in other words, a fill or kill scenario). Pair as GBP/USD, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account. -
DealRequestAtBest
This function is used to deal at market at the best rate available. The DealRequest function may take longer to enter the market, especially in a fast moving market if the deal is rejected. Place trade deal request with Rate at Best. Pair as GBP/USD, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account. -
DealRequestByDealId
This function is like the point and shoot option in position management on the platform. It is used when multiple lots are in exposure for a specified currency pair. You can choose which position you want to trade. This function is not used when only one position is open. A DealID will be requested, which is the ITID returned from the GetDealBlotter function. GetDealBlotter should be called after you enter the position due to the DealBlotter being reset each day at 5 pm EST. Place trade deal request by deal id.DealId as the ID of the deal that you want to close, Pair as GBP/USD, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account. -
Echo
Returns string that you sent as a literal and as a list of ASCII char codes. Use this routine if you wish to test the WebService process or check connectivity. -
GetAccount
Account parameters -
GetAccountDetails
Account parameters -
GetAccountObject
Account parameters. Notes field may be used to describe the client. Use 'GAIN' as the default value for brand. -
GetAccountServices
Account Services -
GetComment
GAIN Commentary. Returns top three GAIN Commentry items. -
GetCommentDataSet
Comment DataSet -
GetCustomMarginBlotter
Custom Margin blotter -
GetCustomPositionBlotter
Custom Position blotter -
GetDealBlotter
User Deal blotter -
GetDealBlotterDataSet
Deal Blotter DataSet -
GetDealBlotterDataSetWithFilter
Deal Blotter DataSet with filter -
GetDealBlotterWithFilter
User Deal blotter with Filter -
GetDelayedRatesDataSet
Delayed Rates DataSet -
GetEconomicCalendar
Economic Calendar -
GetHistoricRatesDataSet
DataSet of historic market rates up to 24 hours maximum. The required parameter is a Key, Quote, StartDateTime, and EndDateTime. Key can be retrieved from the GetRatesServerAuth function. Quote is in the form CCY/CCY i.e. GBP/USD. StartDateTime and EndDateTime is in the form YYYY-MM-DD HH:MM:SS i.e. 2006-08-16 11:03:25. -
GetIGAuthenticationKey
Returns the Key required to login into the IG Platform. -
GetMarginBlotter
User Margin blotter -
GetMarginBlotterDataSet
Margin Blotter DataSet. Returns account specific balance information such as Margin Balance, Account Balance, P/L, and more. -
GetNews
Market News. Returns top three News items. -
GetNewsDataSet
News DataSet -
GetOrderBlotter
User Order blotter -
GetOrderBlotterDataSet
Order Blotter DataSet which Returns any open orders in the account. -
GetPairSettings
Provides Customer Pair Settings -
GetPositionBlotter
User Position blotter.Returns the current open positions as displayed in position management. The input, Key, can be retrieved from the GetRatesServerAuth function. -
GetPositionBlotterDataSet
Position Blotter DataSet which relates to all the details for any current open positions associated to the account. -
GetProductSubscriptionRelationshipBlotter
Provides the list of currency pairs with their counter and contract pairs and two flags bSubscibe and bcansubscribe. The Contract and Counter specify what Pairs are related to the CcyPair and are required to be subscribed if cCcyPair is subscribed to. The bSubscribe indicates if the Pair is currently subscribed to or not. The bCanunscribe defines if the specific Pair can be unscribed or not. -
GetProductSubscriptionRelationshipBlotterDataset
Provides the list of currency pairs with their counter and contract pairs and two flags bSubscibe and bcansubscribe. The Contract and Counter specify what Pairs are related to the CcyPair and are required to be subscribed if cCcyPair is subscribed to. The bSubscribe indicates if the Pair is currently subscribed to or not. The bCanunscribe defines if the specific Pair can be unscribed or not. -
GetRates
Returns Rate details for all the pairs in string format delimited by \ and $. -
GetRatesBlotter
Returns Complete Rate details as in Rates Blotter for all the pairs in string format delimited by \ and $.Message Parameters - PAIR\BID\OFFER\STATUS\HIGH\LOW\DECIMALPLACES\NOTATION\CLOSINGBID\COUNTERPAIR\UPDATEDATETIME$ -
GetRatesDataSet
Rates Snapshot DataSet. Returns the rates and timestamps for all the currency pairs. The required parameter is a ‘Key’ which can be retrieved from the GetRatesServerAuth function. -
GetRatesServerAuth
This function is primarily to authenticate your account. Returns the 'key' string valid for 24hrs used to authenticate with the Rates Server and the blotter functions. This must be called prior to connecting with the rates server or the blotters each day. Please contact Customer Service with any questions regarding Brand Code. -
GetSubAccountAuthenticationKey
Returns the Sub Account 'Key' string valid for 24hrs used to authenticate with the Rates Server and the blotter functions. This must be called prior to connecting with the rates server or the blotters each day. -
GetSubAccountCode
Returns the Sub Account Code using the master account code and the sub account number -
GetSubAccountNumber
Returns the AccountNumber of the Sub Account using the Customer Code of the Master and the customer code of the Sub Account. -
GetSymbolBlotter
List of traded symbols -
GetSymbolBlotterDataSet
Symbol Blotter DataSet.Returns all the possible currency pairs to trade in their respective currency symbols. The parameters are your UserID and password. -
GetTicker
Ticker -
GetTime
Returns the server time (UTC), can be used as a connection keep-alive if you so wish. -
GetlTIDByBankConf
Returns the LTID corresponding to the deal BankConfirmation number passed in, provided the deal is open. If no record is found returns -1 -
ModifyIfThenOCOOrder
Modify If Then OCO Trade order.Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
ModifyIfThenOrder
Modify If Then Trade order.Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
ModifyOCOASSPOrder
Modify OCO Associated Position Trade order. Pair as GBP/USD. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
ModifyOCOOrder
Modify OCO trade order. Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
ModifySingleASSPOrder
Modify Single Associated Position Trade order.This allows you to modify an associated position2 order which has already been created. OrderReference is a parameter to identify which particular order is to be modified. OrderReference can be retrieved when creating the order through the PlaceSingleASSOrder or the PlaceSingleOrder function. CustomerOrderReference, returned from these functions, can be used as the OrderReference. Pair as GBP/USD, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
ModifySingleOrder
Modify single trade order.This allows you to modify an order which has already been created. OrderReference is a parameter that identifies which particular order is to be modified and can be retrieved from many order functions. The order functions return CustomerOrderReference which corresponds to the OrderReference parameter. Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceIfThenOCOOrder
If/Then OCO order is a conditional order providing that if the first order (If order) is executed, the second order (Then order) is activated as a live, One Cancels Other (OCO) order. Full description of an OCO1 order. The execution of either one of the two Then orders automatically cancels the other. In cases where the If single order does not execute, the Then OCO1 order will remain dormant. When any part of an If / Then OCO1 order is cancelled, including either leg of the OCO1 order, all parts of the order are cancelled as well.Place If Then OCO Trade order.Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceIfThenOrder
Place If Then Trade order.The If/Then order is a conditional order providing that if the first order (If order) is executed, the second order (Then order) is activated as a live, single order. In cases where the If order does not execute, the Then single order will remain dormant. When either part of an If / Then order is cancelled, all parts of the order are cancelled as well.Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceOCOASSPOrder
Place OCO Associated Position Trade order. Pair as GBP/USD. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceOCOOrder
Place OCO trade order.This function enables you to create an order in which one part of the order is cancelled if the other part is executed. Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceSingleASSPOrder
Place Single Associated Position Trade order. This is an order to create the stop loss or limit to an open position. Pair as GBP/USD, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
PlaceSingleOrder
Place single trade order.Allows you to create a simple order to be executed in the future through which a position can be opened. Pair as GBP/USD, Expiry as EOD or GTC, BuySell as B or S, Amount as multiple of 10,000 or 100,000 depending upon account, Order Basis as S or T for Stop loss or LimiT. Warning: Trade Order can take up to 60 seconds to be placed into the order process. Use DealRequest for immediate execution. -
SaveUserProductSubscriptionSettings
Updates the Subscribed Product List based on the comma separated Pairs listed in SubscribedPairs String -
ServiceAuthentication
Returns True/False if the Requested Service Tool is enabled/disabled for the user. -
VerifyCredentials
Returns True if the credentials are valid and false if Invalid. Please contact Customer Service with any questions regarding Brand Code.