BidFX
Excel API
Revision number:
3
Revision Date:
2022-03-14
Client Support:
askfx@bidfx.com
Australia: +61 1300 097 908
Singapore: +65 3129 3838
Hong Kong: +852 3001 5868
UK: +44 808 281 2526 or
+44 208 154 5655
US: +1 833 900 2526
Excel API
© 2022 BidFX Systems Ltd. 2 of 32
BidFX Systems Limited
Legal Notices
This document and all portions thereof are the exclusive property of BidFX Systems Ltd. This document is protected
by copyright law and international treaties. Unauthorized possession, reproduction, duplication, or dissemination of
this document, or any portion of it, is illegal and may result in severe civil and criminal penalties. Prosecution will be
to the maximum extent possible under the law.
All BidFX computer programs and all BidFX source code are the exclusive property of BidFX. All such programs,
regardless of distributed form, are protected by copyright law and international treaties. Unauthorized reproduction
of such programs and/or code, or any portions thereof, may result in severe civil and criminal penalties, and will be
prosecuted to the maximum extent possible under the law.
This document is provided “as is”, without warranty of any kind, either express or implied, including, but not limited
to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. Information in
this document is subject to change without notice. Technical updates are periodically added to the information
herein. BidFX may make improvements and/or changes to the product(s) and/or the program(s) described in this
publication at any time.
Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without
the express written permission of BidFX.
Excel API
© 2022 BidFX Systems Ltd. 3 of 32
About BidFX .................................................................................................................................. 4
Introduction ................................................................................................................................. 4
Related APIs ................................................................................................................................. 4
Programming Language .............................................................................................................. 5
Installation ................................................................................................................................... 5
Guides on Usage .......................................................................................................................... 5
Serial Keys and Logging in...................................................................................................... 5
Creating a Subject ID .............................................................................................................. 7
Streaming Subject ID .......................................................................................................... 7
Quote Subject ID ................................................................................................................. 8
Depth Subject ID ................................................................................................................. 9
Indicative Pricing Subject ID ........................................................................................... 10
Valid Tenors ....................................................................................................................... 10
Getting a price field .............................................................................................................. 11
Direct RTD Calls ................................................................................................................. 12
Price Field Names.................................................................................................................. 13
Formatting Time Fields ........................................................................................................ 15
Example .................................................................................................................................. 16
LP Names ............................................................................................................................... 16
Trading ........................................................................................................................................ 20
Enable Trading ....................................................................................................................... 20
Staging An Order ................................................................................................................... 20
Trading Ticket .................................................................................................................... 20
Functions ........................................................................................................................... 21
Example: ........................................................................................................................ 22
FX Limit orders .................................................................................................................. 23
Order Parameters ............................................................................................................. 24
FX Orders....................................................................................................................... 24
Futures Orders ............................................................................................................. 26
Creating Custom Allocation Templates ......................................................................... 27
Getting Settlement and Fixing Dates ...................................................................................... 27
BXSETTLEMENTDATE ............................................................................................................. 28
BXFIXINGDATE ....................................................................................................................... 28
Points of Presence ..................................................................................................................... 28
Production ............................................................................................................................. 28
Test environments ................................................................................................................ 29
Logging ........................................................................................................................................ 29
Sharing Spreadsheets ............................................................................................................... 29
Excel API
© 2022 BidFX Systems Ltd. 4 of 32
About BidFX
BidFX is the market leading provider of electronic trading solutions for the global FX
marketplace. BidFX has addressed the challenges of the FX market head on by introducing a
complete suite of negotiation protocols which include: auto-routing, streaming, request-for-
quote, voice and algo trading via a cloud-based trading platform incorporating best-execution.
Clients have access to cutting edge, broker neutral, Execution Management System (EMS)
backed by a hub to all major bank's algo suites. Read about all of our
products www.bidfx.com.
Introduction
This document describes the usage of the BidFX product offering for Microsoft Excel®. The
client consists of an Excel add-in, an embedded Real Time Data (RTD) component for
streaming quotes, and the BidFX .NET client API. These work together to provide real-time
pricing and order flow via Excel. Once authenticated, the add-in connects Excel directly to the
BidFX trading platform using secure connections over which all data is encrypted in transit.
Liquidity Providers (LP) publish their price quotes into the BidFX platform using the FIX
protocol. The platform ingress flow involves billions for FIX messages per day. BidFX provision
for this purpose high-bandwidth, cross-connect circuits in the key FX data centres: London
(LD4), New York (NY4) and Tokyo (TY3). The Excel API makes use of highly optimised, bespoke
binary protocols to deliver realtime quotes from your LPs directly into Excel. The BidFX
delivery mechanism is approximately 80 times more efficient than the FIX protocol and we
publish to Excel only those quotes that are requested via a publish and subscribe paradigm.
On the order routing side, Excel can be used to stage orders into the BidFX EMS, from where
they can either be:
worked using our TradeSmart® GUI
auto-routed to a strategy engine that manages synthetic order types for best
execution, including: market and limit orders.
Related APIs
Other API offerings from BidFX include:
REST APIs for order routing, and trade reports over simple web requests.
Microsoft® .NET APIs for tradable FX quotes, top-of-book, futures pricing, indicative FX
pricing and order routing.
Java API for tradable FX quotes, top-of-book, futures pricing, indicative FX pricing
and order routing.
Excel API
© 2022 BidFX Systems Ltd. 5 of 32
Programming Language
The excel add-in contains small amount of VBA code that wraps a .NET API. Both the RTD
server and client API are written in C# 4.0.
Installation
The excel add-in is provided as a windows installer. The installer will register the RTD server,
copy the add-in to %APPDATA%/Roaming/Microsoft/AddIns and install the AddIn to Excel.
Excel must be closed when you run the installer. The installer will prompt you to close Excel if
it is open.
We recommend running the installer locally on your machine.
The add-in requires write access to the user's APPDATA directory for logging and serial keys.
Guides on Usage
To use the client you will need to install BidFX Excel, please see the Installation section of this
document for instructions.
Serial Keys and Logging in
To log into the BidFX servers you will need to make use of the BidFX tab within Excel:
In order to log in you must have a valid serial key. This is provided by BidFX and is tied to your
username and the environment. To register the serial key, click on the
Settings
icon.
Excel API
© 2022 BidFX Systems Ltd. 6 of 32
You can enter multiple serial keys. Entering a serial key for an existing user and environment
pair will overwrite the existing entry. Click submit to save the serial. The serials will remain
registered, even after turning off your PC.
Serial keys are written to the BidFX directory in the user's APPDATA
To log in, click on the Login button in the BidFX tab. You will then see a pop up appear asking
for your username, your password, the environment, and the point-of-presence, like so:
After filling in these fields and clicking log in you'll either get a pop up saying "Logged in." or
"Invalid Credentials." depending on if your credentials are correct. In the event of a bad
connection or other unforeseen error, the pop-up will say "Log in Failed".
Excel API
© 2022 BidFX Systems Ltd. 7 of 32
Creating a Subject ID
To get pricing data, you need to create a Subject ID. The following methods will return a
SID
which can be used to get price fields. SIDs are generated by the application and will remain
constant whenever Excel is closed and opened, but will change if the underlying subject is
changed.
Streaming Subject ID
The method signature for getting a SubjectId for streaming pricing is as follows:
=BXSTREAMSID(BuySideAccount, AllocationTemplate, CcyPair, DealType,
LiquidityProvider, Ccy, Quantity, Tenor, SettlementDate, FarQuantity, FarTenor,
FarSettlementDate)
Name
Type
Description
Required
BuySideAccount
String
The name of your
account set up with
BidFX
Yes. Account or
Allocation Template
required
If both are specified,
Allocation Template will
take precedence
AllocationTemplate
String
The name of a pre-
trade allocation
template
CcyPair
String
The currency pair to
subscribe to
Yes.
DealType
String
The deal type (Spot,
Forward, NDF, Swap,
NDS)
Yes.
LiquidityProvider
String
The liquidity
provider to
subscribe to
Yes.
Ccy
String
The dealt currency
Yes.
Quantity
Double
The quantity to
subscribe to
Yes.
Tenor
String
The tenor
If DealType is not Spot
SettlementDate
String
The settlement date
If Tenor is "BD"
FarQuantity
Double
The quantity of the
second leg
If DealType is Swap or
NDS
Excel API
© 2022 BidFX Systems Ltd. 8 of 32
Name
Type
Description
Required
FarTenor
String
The second leg
tenor
If DealType is Swap or
NDS
FarSettlementDate
String
The second leg
settlement date
If FarTenor is "BD"
Quote Subject ID
The method signature for getting a SubjectId for quote pricing is as follows:
=BXQUOTESID(BuySideAccount, AllocationTemplate, CcyPair, DealType,
LiquidityProvider, Ccy, Quantity, Tenor, SettlementDate, FarQuantity, FarTenor,
FarSettlementDate)
Name
Type
Description
Required
BuySideAccount
String
The name of your
account set up with
BidFX
Yes. Account or
Allocation Template
required
If both are specified,
Allocation Template will
take precedence
AllocationTemplate
String
The name of a pre-
trade allocation
template
CcyPair
String
The currency pair to
subscribe to
Yes.
DealType
String
The deal type (Spot,
Forward, NDF, Swap,
NDS)
Yes.
LiquidityProvider
String
The liquidity
provider to
subscribe to
Yes.
Ccy
String
The dealt currency
Yes.
Quantity
Double
The quantity to
subscribe to
Yes.
Tenor
String
The tenor
If DealType is not Spot
SettlementDate
String
The settlement date
or tenor
If Tenor is "BD"
Excel API
© 2022 BidFX Systems Ltd. 9 of 32
Name
Type
Description
Required
FarQuantity
Double
The quantity of the
second leg
If DealType is Swap or
NDS
FarTenor
String
The second leg
tenor
If DealType is Swap or
NDS
FarSettlementDate
String
The second leg
settlement date
If FarTenor is "BD"
When a liquidity provider expires the quote stream you will see a status of CLOSED appear in
the excel cell. If you need to refresh these subscriptions, it can be done via the Refresh button
in the BidFX tab.
Depth Subject ID
The method signature for getting a SubjectId for depth pricing is as follows:
=BXDEPTHSID(BuySideAccount, AllocationTemplate, CcyPair, DealType, Ccy, Quantity,
SettlementDate, Rows)
Name
Type
Description
Required
Example
Value
BuySideAccount
String
The name of your account
set up with BidFX
Yes. Account or
Allocation
Template
required
If both are
specified,
Allocation
Template will
take
precedence
"FX_ACCT"
AllocationTemplate
String
The name of a pre-trade
allocation template
"FX_ALLOC"
CcyPair
String
The currency pair to
subscribe to
Yes.
"USDKRW"
DealType
String
The deal type (Spot,
Forward, NDF)
Yes.
"NDF"
Ccy
String
The dealt currency
Yes.
"USD"
Quantity
Double
The quantity to subscribe to
Yes.
1000000.00
Excel API
© 2022 BidFX Systems Ltd. 10 of 32
Name
Type
Description
Required
Example
Value
Tenor
String
The tenor
If DealType is
not Spot
"2Y"
SettlementDate
String
The settlement date
If Tenor is "BD"
"20200812"
Rows
Integer
The maximum number of
rows for the server to
return. If you are only
interested in the best price,
set to '1' for improved
performance. Leave empty
or set to 0 for full book.
3
The default maximum number of market depth subscriptions that can be active at any time is
20. Removing the BXDEPTHSID or all BXPRICE fields that refer to a SID will automatically
unsubscribe from that Subject and attempt to resubscribe on a Subject that was over the
limit.
Indicative Pricing Subject ID
The method signature for getting a SubjectId for indicative pricing is as follows:
=BXINDICATIVESID(CcyPair)
Name
Type
Description
Required
Example Value
CcyPair
String
The currency pair to subscribe to
Yes.
"EURUSD"
Valid Tenors
Tenor Code
Note
TOD
Today
TOM
Tomorrow
SPOT
Spot (only valid for Swap deal types on the near leg)
SPOT_NEXT
Spot + 1
1W
1 week
2W
2 week
3W
3 week
Excel API
© 2022 BidFX Systems Ltd. 11 of 32
Tenor Code
Note
1M
1 month
2M
2 month
3M
3 month
4M
4 month
5M
5 month
6M
6 month
7M
7 month
8M
8 month
9M
9 month
10M
10 month
11M
11 month
1Y
1 year
2Y
2 year
3Y
3 year
BD
Broken date - requires an explicit settlement date
IMMH
IMM† March contract (3rd Wednesday of month)
IMMM
IMM June contract (3rd Wednesday of month)
IMMU
IMM September contract (3rd Wednesday of month)
IMMZ
IMM December contract (3rd Wednesday of month)
† The IMM is the International Money Market for currency futures.
Getting a price field
Once you have a SubjectId, you can use the method BXPRICE to extract price information:
=BXPRICE(SID, FieldName, Depth)
The table below defines all the parameters:
Excel API
© 2022 BidFX Systems Ltd. 12 of 32
Name
Type
Description
Required
Example
Value
SID
Integer
The SubjectId returned from a
subject method
Yes.
9
FieldName
String
The name of a field returned from
a subscription
Yes.
"Bid"
Depth
Integer
The depth of the field to be
returned from a Depth
subscription
e.g. FieldName = "Bid", Depth = 1
will return the best bid from the
book
For Depth and
Premium Pricing
1
Direct RTD Calls
Due to the way Excel processes User Defined Functions, large spreadsheets with hundreds of
calls to BXPRICE may become noticably slow. You can massively improve performance by
making the RTD calls yourself. The RTD formula has the following syntax:
=RTD("bidfx.priceserver",,"sid", SID, FieldName, Depth)
The 'Get Price Field' tool will help you to create the formula:
Excel API
© 2022 BidFX Systems Ltd. 13 of 32
The 'Target Cell' will have its contents replaced by the RTD formula. The target cell may appear
blank until data is available to be displayed.
All results returned from the RTD call are strings. The Get Price Field tool will automatically
surround the RTD call with VALUE() if you are accessing a Bid or Ask field to convert it to a
numeric type.
BidTime and AskTime returned from an RTD call on a Depth subject are Java Timestamps
(Milliseconds since 1 jan 1970). The Get Price Field tool will automatically surround the RTD
call with BXTIME(), which will convert the timestamp into a number that Excel can correctly
format as a date-time, if you are accessing a suitable BidTime or AskTime field.
Price Field Names
The table below defines some of the more common field names that can be returned from a
subscription.
FieldName
Stream &
Quote
Depth
Indicative
Notes
Bid
Yes
Yes
Yes
Depth and PremiumFX subjects
require a Depth Parameter
Ask
Yes
Yes
Yes
Depth and PremiumFX subjects
require a Depth Parameter
BidAllInPrice
Yes (Swap
& NDS)
BidEndAllInPrice
Yes (Swap
& NDS)
AskAllInPrice
Yes (Swap
& NDS)
AskEndAllInPrice
Yes (Swap
& NDS)
BidForwardPoints
Yes
(except
Spot)
Yes
AskForwardPoints
Yes
(except
Spot)
Yes
BidFirm
Yes
Requires a Depth Parameter
Excel API
© 2022 BidFX Systems Ltd. 14 of 32
FieldName
Stream &
Quote
Depth
Indicative
Notes
AskFirm
Yes
Requires a Depth Parameter
BidSize
Yes
Requires a Depth Parameter
AskSize
Yes
Requires a Depth Parameter
BidEndSize
Yes (Swap
& NDS)
AskEndSize
Yes (Swap
& NDS)
BidTime
Yes
Yes
For Indicative this is a string of the
form yyyy-mm-ddThh:mm:ss.000Z
For Depth a Depth Parameter is
required and is a number
representing an Excel time
AskTime
Yes
Yes
For Indicative this is a string of the
form yyyy-mm-ddThh:mm:ss.000Z
For Depth a Depth Parameter is
required and is a number
representing an Excel time
BidLevels
Yes
AskLevels
Yes
OriginTime
Yes
Is a number representing an Excel
time
PriceID
Yes
BidSpot
Yes
Yes
AskSpot
Yes
Yes
SystemTime
Yes
Yes
Is a string of the form yyyy-mm-
ddThh:mm:ss.000Z
High
Yes
Low
Yes
Excel API
© 2022 BidFX Systems Ltd. 15 of 32
FieldName
Stream &
Quote
Depth
Indicative
Notes
Broker
Yes
PercentChange
Yes
LastTick
Yes
Open
Yes
Close
Yes
Provider
Yes
NetChange
Yes
Status
Yes
Formatting Time Fields
When accessing a time field (BidTime
n
, AskTime
n
, OriginTime) from a subscription, the value
returned will be a number representing an Excel date to Millisecond precision.
You can convert this number to a readable format with the following custom type:
yyyy/mm/dd hh:mm:ss.000
Excel API
© 2022 BidFX Systems Ltd. 16 of 32
Example
The following formulas will get the top-3-of-book for GBPUSD Spot 1M
A
B
C
D
E
F
G
H
1
Acco
unt
CcyPair
DealType
Ccy
Qty
Tenor
Settleme
ntDate
SubjectId
2
MY_A
CCO
UNT
GBPUSD
Spot
=LEFT(B2,
3)
10000000
=BXDEPTHSID(
A2,,B2,C2,D2,E
2,F2,G2)
3
4
5
Dept
h
BidSize
BidFirm
Bid
Ask
AskFirm
AskSize
6
1
=BXPRICE
($H$2,B$
5,$A6)
=BXPRICE
($H$2,C$
5,$A6)
=BXPRICE
($H$2,D$
5,$A6)
=BXPRICE
($H$2,E$
5,$A6)
=BXPRICE
($H$2,F$
5,$A6)
=BXPRICE
($H$2,G$
5,$A6)
7
2
=BXPRICE
($H$2,B$
5,$A7)
=BXPRICE
($H$2,C$
5,$A7)
=BXPRICE
($H$2,D$
5,$A7)
=BXPRICE
($H$2,E$
5,$A7)
=BXPRICE
($H$2,F$
5,$A7)
=BXPRICE
($H$2,G$
5,$A7)
8
3
=BXPRICE
($H$2,B$
5,$A8)
=BXPRICE
($H$2,C$
5,$A8)
=BXPRICE
($H$2,D$
5,$A8)
=BXPRICE
($H$2,E$
5,$A8)
=BXPRICE
($H$2,F$
5,$A8)
=BXPRICE
($H$2,G$
5,$A8)
LP Names
The following names are available for subscription. You may not have permission to subscribe
to all of them. Contact your account manager for a complete, up-to-date list of your available
LPs.
PROD
UATPROD
ANZFX
ANZFX
Australia and New Zealand Banking Group
BOFAFX
BOFAFX
Bank of America
BARCFX
BARCFX
Barclays
BMOFX
BMOFX
Bank of Montreal
Excel API
© 2022 BidFX Systems Ltd. 17 of 32
PROD
UATPROD
BNPFX
BNPFX
BNPP - Banque Nationale de Paris Paribas
BNYFX
BNYMFX
The Bank of New York Mellon Corporation
BNYX
BNY Sell Side
BWAYFX
Broadway Technologies
CACIBFX
CACIBFX
Credit Agricole Corporate Investment Bank
CITAFX
CBOE CITADEL
CBOEFXDB
CBOEFX DB
CBOEFX
CBOE FX
CBOEFXHS
CBOEFX HSBC
CBOEFXCITI
CBOEFX CITI
CBOEJPM
CBOE JPM
CBOEML
CBOE ML
CBOEFXNW
CBOEFX NW
CBOEFXPB1
CBOEFX PB1
CBOEFXPB2
CBOEFX PB2
CBOEFXPB4
CBOEFX PB4
CBOECITADB
CBOE Citadel DB
CBOECITAHS
CBOE Citadel HSBC
CBOECITAHS
CBOE Citadel HSBC
CBOECITANWM
CBOE Citadel Natwest Markets (RBS)
CITA
CITDLFX
Citadel Securities
CITIFX
CITIFX
Citigroup
COBAFX
COBAFX
Commerzbank AG
CSFX
CSFX
Credit Suisse
DBSX
DBSX
DBS Ltd
Excel API
© 2022 BidFX Systems Ltd. 18 of 32
PROD
UATPROD
DBFX
DBFX
Deutsche Bank AG
EDGWFX
EDGWFX
Edgewater Markets
FLEXFX
FlexTrade Bank
FASTMATCHFX
FASTMATCHFX
Fastmatch
GLENFX
Gleneagle Securities
GSFX
GSFX
Goldman, Sachs
GSPMFX
GSPMFX
Goldman Sachs Precious Metals
HSFX
hs Bank
HSBCFX
HSBCFX
HSBC - Hong Kong and Shanghai Bank
HSNCFX
hsnc Bank
HOTSPOTFX2
Hotspot
INGX
INGFX
ING Commercial Banking
INVLFX
INVSTCFX
Investec Bank
JEFFX
JEFFX
Jefferies LLC
JPMCFX
JPMCFX
JP Morgan
JUMPFX
JUMPFX
Jump Trading Futures, LLC
LUCIDFX
LUCIDFX
Lucid Markets LLP
MIZUHFX
MIZUHFX
Mizuho Bank
MSFX
MSFX
Morgan Stanley
NATIXISFX
NATIXISFX
Natixis - Global Markets
NOMURAFX
NOMURAFX
Nomura
NORDEAFX
NORDEA Bank
RBSFX
RBSFX
RBS - Royal Bank of Scotland
QTICFX
Quantic Prime
RBCFX
RBCFX
RBC - Royal Bank of Canada
Excel API
© 2022 BidFX Systems Ltd. 19 of 32
PROD
UATPROD
SEBFX
SEBFX
SEB Group - Skandinaviska Enskilda Banken
SGXFX
SGX FX
SGFX
SGFX
SocGen - Societe Generale
SSFX
SSFX
State Street
SCBFX
SCBFX
Standard Chartered Bank
TDFX
TDSFX
TD Securities
TSFX
TSFX
Tradingscreen FX simulator
TS10FX
TS10 Bank
TS11FX
TS11 Bank
TS12FX
TS12 Bank
TS2FX
TS2 Bank
TS3FX
TS3 Bank
TS4FX
TS4 Bank
TS5FX
TS5 Bank
TS6FX
TS6 Bank
TS7FX
TS7 Bank
TS8FX
TS8 Bank
TS9FX
TS9 Bank
UBSFX
UBSFX
UBS - Union Bank of Switzerland
XTXFX
XTXFX
XTX Markets
XTXCITIFX
XTX Markets for BFAM Citi
XTXHSBCFX
XTX Markets for AHL HSBC
XTXRBSFX
XTX Markets for AHL RBS
XTXUBSFX
XTX Markets for BFAM UBS
Excel API
© 2022 BidFX Systems Ltd. 20 of 32
Trading
Enable Trading
When Excel is opened Trading is disabled by default. Click on the "Toggle Trading" button in
the BidFX tab to enable trading via Excel.
Staging An Order
Currently all orders sent through the Excel API are only staged but not submitted for
execution. Opening up the order center in TradeSmart will allow you to see the state of orders
and send them for execution.
Trading Ticket
Click the 'FX ticket' button to open an FX trading ticket window, and "Futures ticket" to open a
Futures trading ticket window.
The Trading field will show the current status of the trading functionality. Click it to toggle
whether trading is enabled or disabled.
Excel API
© 2022 BidFX Systems Ltd. 21 of 32
Fields can contain either a cell reference or a literal value. Literal values must be surrounded
with double quotes (" ").
Press "Submit Order" to send the order to the server. The order TSId assigned by the server
will be returned in a pop up window.
Functions
Orders can also be staged using the functions BXLIMITORDER and BXMARKETORDER, for FX
Limit and Market Orders respectively:
BXLIMITORDER(Account, AllocationTemplate, CcyPair, DealType, Ccy, Quantity, Price,
Side, Tenor, SettlementDate, FixingDate, ReferenceOne, ReferenceTwo)
BXMARKETORDER(Account, AllocationTemplate, CcyPair, DealType, Ccy, Quantity, Side,
Tenor, SettlementDate, FarFixingDate, ReferenceOne, ReferenceTwo)
Futures orders can be staged using the functions BXFUTURELIMIT and BXFUTUREMARKET:
Excel API
© 2022 BidFX Systems Ltd. 22 of 32
BXFUTURELIMIT(Account, AllocationTemplate, InstrumentCode, CodeType, Side,
Quantity, Price, TimeInForce, GoodTillDate, ReferenceOne, ReferenceTwo)
BXFUTUREMARKET(Account, AllocationTemplate, InstrumentCode, CodeType, Side,
Quantity, TimeInForce, GoodTillDate, ReferenceOne, ReferenceTwo)
It is not recommended to use these functions in a cell as this could cause the order to be
submitted multiple times, especially when using cell references. Instead, you should call
BidFXExcel.BXLIMITORDER(Account, AllocationTemplate, CcyPair, DealType, Ccy,
Quantity, Price, Side, Tenor, SettlementDate, FixingDate, ReferenceOne,
ReferenceTwo)
BidFXExcel.BXMARKETORDER(Account, AllocationTemplate, CcyPair, DealType, Ccy,
Quantity, Side, Tenor, SettlementDate, FixingDate, ReferenceOne, ReferenceTwo)
BidFXExcel.BXFUTURELIMIT(Account, AllocationTemplate, InstrumentCode, CodeType,
Side, Quantity, Price, TimeInForce, GoodTillDate, ReferenceOne, ReferenceTwo)
BidFXExcel.BXFUTUREMARKET(Account, AllocationTemplate, InstrumentCode, CodeType,
Side, Quantity, TimeInForce, GoodTIllDate, ReferenceOne, ReferenceTwo)
from a macro.
Example:
1. Ensure BidFXExcel is added as a reference for the VBA.
2. Open the VBA window (Alt + F11). Create a custom macro that calls BXLIMITORDER. In
this example the output from the call (an Order TSId) is delivered in a pop-up message
box.
Excel API
© 2022 BidFX Systems Ltd. 23 of 32
3. From the developer tab, insert a new button.
4. Assign the macro to the button.
5. Clicking the button will ensure the Order is only placed once.
FX Limit orders
FX Limit orders are staged with a Time In Force of DAY
Excel API
© 2022 BidFX Systems Ltd. 24 of 32
Order Parameters
FX Orders
Name
Type
Description
Required
Example Value
Account
String
The account
with which to
stage this
order.
Yes. Account
or Allocation
Template
required
When using an
allocation
template
created by
BXALLOCATIO
N, Account
represents the
Executing
Account.
When using
the name of a
pre-defined
allocation
template the
value of
Account is
overwritten by
the executing
account
defined by the
template.
"FX_ACCT"
AllocationTempla
te
String
The name of a
pre-trade
allocation
template with
which to
stage this
order, or the
ID of a
custom
allocation
template
created using
BXALLOCATIO
N
"AllocTemplate_123"
"a123b6bbdea2fd23da209d
aa"
CcyPair
String
The currency
pair to trade
with
Yes
"GBPUSD
DealType
String
The deal type
(Spot,
Forward, NDF)
Yes
"Spot"
Ccy
String
The dealt
currency
Yes
"GBP"
Excel API
© 2022 BidFX Systems Ltd. 25 of 32
Name
Type
Description
Required
Example Value
Quantity
Decim
al
The quantity
to trade
Yes
1000000
Price
Decim
al
The price to
trade at
For Limit
Orders
1.38
Side
String
The side of
the
transaction
(Buy, Sell).
For SWAP and
NDS, this
represents
the Near side.
(i.e. "Buy"
means "B/S")
Yes
"Buy"
Tenor
String
The tenor
All but Spot
"Spot"
SettlementDate
String
The
settlement
date for the
trade
If tenor is
"BD".
"20200812"
FixingDate
String
The fixing
date for a
non-
deliverable
trade
"20200810"
ReferenceOne
String
STP Reference
Field
"This is a reference"
ReferenceTwo
String
STP Reference
Field Two
"This is a second reference"
FarQuantity
String
The quantity
of the far leg
of a Swap or
NDS
For Swap/NDS
"1000000"
FarTenor
String
The tenor of
the far leg of
For Swap/NDS
"6M"
Excel API
© 2022 BidFX Systems Ltd. 26 of 32
Name
Type
Description
Required
Example Value
a Swap or
NDS
FarSettlementDat
e
String
The
settlement
date of the far
leg of a Swap
or NDS
If FarTenor is
"BD".
"20210810"
Futures Orders
Name
Type
Description
Required
Example Value
Account
String
The account with
which to stage this
order.
Yes. Account or
Allocation
Template
required
If both are
specified,
Allocation
Template will
take
precedence
"FX_ACCT"
AllocationTemplate
String
The name of a pre-
trade allocation
template with
which to stage this
order
"AllocTemplate_123"
InstrumentCode
String
An identifying code
for the Futures
contract
Yes
"DEH0"
CodeType
String
The type of
instrument code
used (BLOOMBERG,
RIC, ISIN, SEDOL,
CUSIP, VALOREN)
Yes
"BLOOMBERG"
Quantity
Decimal
The quantity to
trade
Yes
50
Price
Decimal
The price to trade
at
For Limit
Orders
97.68
Excel API
© 2022 BidFX Systems Ltd. 27 of 32
Name
Type
Description
Required
Example Value
Side
String
The side of the
transaction (Buy,
Sell)
Yes
"Buy"
TimeInForce
String
The time in force
(DAY, GTC - Good
Till Cancel, GTD -
Good Till Date)
Yes
"GTD"
ExpiryDate
String
The GTD Expiry
date
If Time In Force
is GTD
"2018-08-15"
ReferenceOne
String
STP Reference Field
"This is a reference"
ReferenceTwo
String
STP Reference Field
Two
"This is a second
reference"
Creating Custom Allocation Templates
Use the BXALLOCATION function to register an allocation template.
=BXALLOCATION(AllocationParams...)
AllocationParams is a variable length set of parameters. Define each allocation as a list of
three parameters:
Parameter
Type
Description
ClearingAccount
String
The clearing account to allocate to. This is an account
display name setup in the TS system
ClearingBroker
String
The clearing broker to allocate to. This is a broker short
name setup in the TS system
Ratio
Decimal
The allocation ratio for this entry.
For example, to register an allocation template with two allocation entries, the formula may
look like:
=BXALLOCATION("Account_1", "Broker_1", 2, "Account_2", "Broker_2", 1)
This formula will return an ID. The formula must remain present on the worksheet in order to
be used in a trade.
Getting Settlement and Fixing Dates
The BXSETTLEMENTDATE and BXFIXINGDATE functions can be used to find the settlement
date for a given tenor, and a fixing date for a given tenor or settlement date, respectively.
Excel API
© 2022 BidFX Systems Ltd. 28 of 32
BXSETTLEMENTDATE
Parameter
Type
Description
CcyPair
String
The currency pair to get the settlement date for
Tenor
String
The tenor to get the settlement date for
Deliverable
Boolean
Whether the currency pair is deliverable or not
BXFIXINGDATE
Parameter
Type
Description
CcyPair
String
The currency pair to get the fixing date for
Tenor
String
The tenor to get the fixing date for. Use "BD" to supply a
settlement date.
SettlementDate
String
Optional. Used with Tenor = "BD"
The settlement date to get the fixing date for. YYYYMMDD
Points of Presence
BidFX provide a number of points-of-presence (POPs) around the world via which clients may
connect to our global price service:
Production
Clients are encouraged to connect to their geographically closest access point for minimum
latency.
City
Environment
Point Of Presence
DNS name
IP
Port
London
PROD
LN
api.ld.bidfx.com
64.52.164.90
443
New York
PROD
NY
api.ny.bidfx.com
64.52.165.90
443
Tokyo
PROD
TK
api.ty.bidfx.com
64.52.166.90
443
Singapore
PROD
SG
api.sg.bidfx.com
64.52.167.90
443
Excel API
© 2022 BidFX Systems Ltd. 29 of 32
Test environments
We provide a test environment, feeding UAT market data. POPs for the test environment are
available in New York and London, so some clients may experience additional latency.
City
Environment
Point Of Presence
DNS name
IP
Port
London
UAT
LN
api.ld.bidfx.biz
64.52.164.80
443
Tokyo
UAT
TK
api.ty.bidfx.biz
64.52.166.80
443
Logging
Bid Excel logs events and processes to %APPDATA%\Roaming\BidFX\BidExcel\BidExcel.log.
Logs will be up to 10MB in size, rolling the files and keeping up to the last 10.
By default the logging level is set to "INFO". You can increase the verbosity of logging by
editing %APPDATA%\Roaming\BidFX\BidExcel\log4net.config. Change the line
<level value="INFO">
to
<level value="DEBUG">
Logging levels can be changed while BidExcel is running and the system will automatically pick
up the change.
Sharing Spreadsheets
If you share a spreadsheet that contains BidFX Excel formulae, the recipient will need to
update the links to the add-in. A pop-up box usually appears when opening a new workbook.
If this window does not appear, go to the Data tab and click "Edit Links".
Enable automatic Updating of links.
Excel API
© 2022 BidFX Systems Ltd. 30 of 32
Click "Edit Links.."
Click "Change Source..."
Navigate (by typing in the address bar) to %AppData%\Microsoft\AddIns and select the bidfx-
public-excel.xlam. Click Ok.
Excel API
© 2022 BidFX Systems Ltd. 31 of 32
Click Update Values and save the worksheet.
Enable automatic Updating of links.
Click "Edit Links.."
Click "Change Source..."
Excel API
© 2022 BidFX Systems Ltd. 32 of 32
Navigate (by typing in the address bar) to %AppData%\Microsoft\AddIns and select the bidfx-
public-excel.xlam. Click Ok.
Click Update Values and save the worksheet.