We use cookies on our website to provide you with a better user experience.

# Updated Excel methods for integration with EXANTE terminal

Important information for everyone who uses the integration with MS Excel. We have updated some methods, and for their correct operation it is necessary to reinstall the connector:

Version for 32-bit Windows

Version for 64-bit Windows

Below we will describe what has changed in the API, now giving a short digression for those who do not know about the possibility of trading through MS Excel. With EXANTE you can place orders, track information on your positions and even automate trading with macros through the familiar MS Excel interface. To do this, you just need to install the connector by downloading it by one of the links above. After that you will be able to perform all the main trading operations, receive account information online and even use trading robots written in a simple and understandable programming language, Visual Basic for Applications (VBA). A detailed guide to the integration and usage of the connector can be downloaded in your clients area. There you will also find some examples of robots.

Integration guide and robot samples

Let’s now get down to what has changed. The quantity request in orders (for example, in the GetQuantity method) now returns a value with the sign, negative for sale and positive for purchase. The SetQuantity method used to place orders works in a similar way. In the previous version, the return quantity was always positive independent from the direction of the transaction.

The ReplaceOrder function works the same way. Now the quantity sign determines the direction of the order, on which the modification takes place. Note that for this function, the operation sign should be the same as for the initial order setting.

In RTD, it is possible to display the list of currencies or instruments in positions. To do this, after the account and the name of the instrument or currency, specify one of the values listed below:

`16. =RTD("atp.rtd«, «atp», «acc.curr», «ABC1234.001», «currencies», «count»)`

`17. =RTD("atp.rtd«, «atp», «acc.curr», «ABC1234.001», «currencies», «to_row»)`

`18. =RTD("atp.rtd«, «atp», «acc.curr», «ABC1234.001», «currencies», «to_column»)`

`19. =RTD("atp.rtd«, «atp», «acc.asset», «ABC1234.001», «assets», «count»)`

`20. =RTD("atp.rtd«, «atp», «acc.asset», «ABC1234.001», «assets», «to_row»)`

`21. =RTD("atp.rtd«, «atp», «acc.asset», «ABC1234.001», «assets», «to_column»)`

Note that formulas 17, 18, 20, 21 require the following macro:

`Function ParseArrayData(ArrayData as String) as Variant`

`ParseArrayData = Evaluate(ArrayData)`

`End Function`

After creating the macro, select several cells, apply the formula below to them and press ctrl + shift + enter:

`=ParseArrayData(RTD(""atp.rtd«, «atp», «acc.curr», «ABC1234.001», «currencies», «to_column»))`

In addition to the above, we have created an Excel template that enables several new functions listed below. Download it here:

Template with new functions Excel

Download the file by the link, enter the necessary formula on any sheet and get the result:

1.` = EXANTEBUY («AccountId», «InstrumentId», qty, [LimitPrice], [StopPrice], [Duration])—` sets a Buy order with the specified parameters. If the specified LimitPrice is different from 0, the order will be Limit. If the specified StopPrice is not equal to 0, the order will have a Stop type, if both parameters are not equal to 0, you will receive a Stop-Limit order. The duration is Day (1) by default, the list of available values is listed in the Value of the ATPDurationType parameter section in the Integration Guide. This function will return the OrderId.

2.` = EXANTESELL («AccountId», «InstrumentId», qty, [LimitPrice], [StopPrice], [Duration])—` sets a Sell order with the specified parameters. If the specified LimitPrice is different from 0, the order will be Limit. If the specified StopPrice is not equal to 0, the order will be stopped. If both parameters are not null, the order will be Stop-Limit. The duration is Day (1) by default; the list of available values is listed in the section Value of the ATPDurationType parameter in the integration guide. The answer is OrderId.

3.` = EXANTEFILLQUANTITY («orderId»)` — returns the number of assets sold or bought at the time of the request in the order with the specified OrderId.

4.` = EXANTEAVGPRICE («orderId»)` — returns the average price of the filled order with the given OrderId at the moment of the request.

If you want to use these functions in your Excel book, import the * .bas file with the code into it:

We hope that your trading experience will now become even more convenient. If you have any questions, do not hesitate to ask our support team: support@exante.eu.