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