Dukascopy FIX
APIProgramming Guide

Revision 8.8.1

Programming Guide for Dukascopy FIX API

CONTENTS:
1. INTRODUCTION

3

2. OVERALL DESCRIPTION

4

3. MESSAGE FLOW

6

4. DATA FEED INTERFACE

7

5. TRADING INTERFACE

9

Copyright © 2021 by Dukascopy Bank SA

Programming Guide for Dukascopy FIX API

1. Introduction

1.1 General Information
Dukascopy FIX API is based on FIX4.4 protocol. The API is used to receive a real-time data feed,submit orders, set / modify / cancel orders, and receive automated notifications of trading activities.
Dukascopy follows the International Organization for Standardization (ISO) currency pair symbol
convention of CCY1/CCY2.
Limit for max orders per second is 16.
Limit for max open positions is 100.

Copyright © 2021 by Dukascopy Bank SA

page 3

Programming Guide for Dukascopy FIX API

2. Overall Description
2.1 Connection Schema
Both clients and Dukascopy FIX engines communicate using SSL-encrypted TCP sockets. No special
SSL certificates needed for now. Client can use either resource provided by FIX engine or using SSL
tunneling. The SSL-tunneling functionality is provided by freely-available open source products.
The time of client's machine should be synchronized with Dukascopy FIX server. Dukascopy uses
GMT time as a base.
Incoming connection is identified by the IP address of the system where client's application isrunning.
There are two FIX connections per client which are used for the FIX interface: one for data feed and
one for Trading.
In order to connect to Dukascopy FIX API server, user must obtain from Dukascopy:• TargetCompId• two SenderCompId• username• password
Client must connect to Dukascopy FIX API server from previously agreed IP addresses and ports. For
each IP address connection attepmts are limited to five per minute per server. The following systemmessages are used:
Logon – a message sent by a client to initiate a FIX session to Dukascopy. The Logon message
establishes the communication session, authenticates the connecting client, and initializes themessage sequence number.
FIX session logon message type „A” should be the first message sent by FIX API client to the server,
after establishing network connection. Note, that password in the client's logon message shouldmatch the expected value, otherwise the session will be terminated.

Copyright © 2021 by Dukascopy Bank SA

page 4

Programming Guide for Dukascopy FIX API

Logon Message Fields
Tag

Tag name

Description

98

EncryptMethod

This field specifies the method of encryption.
Messages are always uncrypted

108HeartBtInt

Heartbeat interval is in seconds. The heartbeat interval
is driven by the FIX client. Default value is 30 seconds

141

ResetSeqNumFlag

Indicates that the both sides of the FIX session should
reset sequence numbers. Should be 'Y' - yes

553

Username

The username provided by Dukascopy

554

Password

The password provided by Dukascopy

Example message:
8=FIX.4.4|9=111|35=A|34=1|49=SampleCompID|52=20210616-11:05:31.322|56=DUKASCOPYFIX|98=0|
108=30|141=Y|553=SampleLogin|554=SamplePassword|10=060|8=FIX.4.4|9=85|35=A|34=1|49=DUKASCOPYFIX|52=20210616-11:05:31.469|56=SampleCompID|98=0|108=30|141=Y|10=145|
Logon message is needed both for Data feed session and trading session.
In case of unsuccessful Logon, FIX server will send Logout message (MsgType=35).
Heartbeat – a message sent by Dukascopy during periods of application inactivity to ensure
connection validity. The FIX client will automatically respond to the heartbeat messages uponreceipt.
Resend Request – a message that can be sent by either Dukascopy or a client, to request certain
messages for resending. The resend is used when gaps are detected in the sequence numbering,message losing, or during the initialization process.
Logout – a message warns about the normal termination of the trading session. Sessions
terminated without a Logout message will be considered an abnormal condition. The Dukascopy
FIX gateway treats a client as logged out whenever the communication session is dropped. Client is
disconnected if session is not restored in 2 hours.

Copyright © 2021 by Dukascopy Bank SA

page 5

Programming Guide for Dukascopy FIX API

3. Message Flow
The following page describes typical message flows.
3.1 Message Flow Matrix (FIX 4.4)
API Client

Direction

Market Data Request(Subscribe)ßßComments
1..n Market Data Requests

àßMarket Data Request

Dukascopy

Market Data
Request RejectMarket Data
Snapshot
Quote Status
ReportIf not a valid request
Streaming prices for subscribed symbols
Information about current status of instrumentsà

Client sends unsubscribe requestà

Client sends an Order (Market, Immediate orCancel, Limit, Stop or Quote)

Order Cancel
Requestà

Client sends order cancel request to cancel
pending limit orders or executing quote orders

Order Cancel /Replace Requestà

Client sends order cancel request to edit
pending limit orders or executing quote orders(Unsubscr)

New Order Single(Market, Limit, Stopor Quote)ßOrderMassStatus
RequestAccount Info
RequestExecution
ReportOrder Acknowledged/Rejected (OrdStatus)
Client sends request to resend all pendingorders and info about currently opened positionsßß

Notification

Text information about system events and order
execution processß

Instrument
Position Info

Information about currently opened positionsàß

Client sends a request for the account details
Account Info

Text information regarding user account

3.2 FIX 4.4 Messages Format
All message formats meet the FIX 4.4 specification. All fields required by FIX are required byDukascopy API, and the order must be according to the FIX specification.
All messages must have all required FIX header / footer fields, BeginString, BodyLength, MsgType,
SenderCompID, TargetCompID, MsgSeqNum, SendingTime, and CheckSum in their appropriate
places according to the FIX 4.4 specification.
Copyright © 2021 by Dukascopy Bank SA

page 6

Programming Guide for Dukascopy FIX API

4. Data Feed interface
4.1 Market Data Request (MsgType = V)
User must send market data request for subscription or un-subscription to / from data feed.
„TimeInForce” field is optional and used only for Fill or Kill data feed subscription.
Tag
262
263
264

265
267
146
55
59

Tag name
MDReqID
Subscription
RequestType
MarketDepth

MDUpdateType
NoMDEntryTypes
NoRelatedSym
Symbol(Instrument block)
TimeInForce

Description
Identifier of request. Set by client.
«Snapshot + Updates (Subscribe)» and «Disable previous
Snapshot + Update Request (Unsubscribe)» is supported
Valid values:'1' Top of Book
'2' .. '5' Number of feed level
Full Refresh (0) is supported only
Must contain both MDEntryType (269) Bid (0) and Offer (1)Must be set to 1 – ONE (or all) instrument only
Currency pair symbol ('EUR/USD' for example) for subscription
to the instruments must be set.
Valid Values:'4' Fill or Kill (FOK)
Use this field only in case if you want to subscribe for “Fill or Kill” data feed

Example messages:
MarketDataRequest Subscribe
8=FIX.4.4|9=157|35=V|34=5|49=FEED_SampleCompID|52=20210616-11:07:16.013|56=DUKASCOPYFIX|262=AUD/CAD 16.06.2021 14:07:16|263=1|264=1|265=0|146=1|55=AUD/CAD|267=2|269=0|269=1|10=076|
MarketDataRequest Unsubscribe
8=FIX.4.4|9=157|35=V|34=6|49=FEED_SampleCompID|52=20210616-11:07:19.111|56=DUKASCOPYFIX|
262=AUD/CAD 16.06.2021 14:07:19|263=2|264=1|265=0|146=1|55=AUD/CAD|267=2|269=0|269=1|
10=083|

4.2 Market Data - Snapshot/full Refresh (MsgType = W)
As a response to «Market Data request» Market Data – Snapshot / Full Refresh starts sending data toclient. 'TimeInForce ' field indicates subscription for “Fill of Kill” data feed.

Copyright © 2021 by Dukascopy Bank SA

page 7

Programming Guide for Dukascopy FIX API

Tag
55
268
269
270
271
59

Tag name
Symbol (Instrument block)
NoMDEntries
MDEntryType
MDEntryPx
MDEntrySize
TimeInForce

273

MDEntryTime

Description
Currency pair for which the market data applies. 'EUR/USD' for example
Number of entries(MDEntryType) in Market Data message(Market depth)
Bid(0) or offer(1)Price of current bid or offer
Value of current bid or offer
Valid Values:'4' Fill or Kill (FOK)This field indicates subscription for “Fill or Kill” data feed.
Time of Market Data Entry

Example message:
8=FIX.4.4|9=228|35=W|34=68|49=DUKASCOPYFIX|52=20210616-11:07:17.266|56=FEED_SampleCompID| 5 5 = AU D / C A D | 2 6 2 = AU D / C A D 1 6 . 0 6 . 2 0 2 1 1 4 : 0 7 : 1 6 | 2 6 8 = 2 | 2 6 9 = 1 | 2 7 0 = 0 . 9 3 8 8 6 | 2 7 1 =1000000|273=11:07:17.268|276=A|269=0|270=0.93869|271=1000000|273=11:07:17.268|276=A|10=030|
4.3 Quote Status Report (MsgType = AI)
The message is used to deliver information about current status of instrument. Dukascopy API server
will automatically send those messages without request upon login or instrument status change. Client
doesn't need to subscribe to receive this information. Use this message to define available instruments.
Tag
117
55
537

Tag name
QuoteID
SymbolQuoteType

Description
Instrument code
Currency pair symbol. 'EUR/USD' for example
Trade status of current instrument.
Can be Tradeable (1) and Restricted Tradeable (2)Example message:
8=FIX.4.4|9=100|35=AI|34=64|49=DUKASCOPYFIX|52=20210616-11:05:32.484|56=FEED_SampleCompID|55=GBP/USD|117=2026|537=1|10=143|
4.4 Market Data Request Reject (MsgType = Y)
If a Market Data Request is not accepted, Dukascopy will send a FIX 4.4„Market Data Request Reject”.
Tag
62
281

Tag name
MDReqID
MDReqRejReason

Copyright © 2021 by Dukascopy Bank SA

Description
Must refer to the MDReqID (262) of the request.
Folowing values can be set:
'0' Unknown symbol'4' Unsupported SubscriptionReq'5' Unsupported MarketDepth'6' Unsupported MDUpdateType'8' Unsupported MDEntryType
page 8Programming Guide for Dukascopy FIX API

5. Trading Interface
After client successfully logged into a FIX API server, the server automatically sends to client
Execution Reports about orders in pending or executing state.
5.1 Execution Report (MsgType=8)
If an order has been partially filled, then for each remaining order execution, an execution report will
be sent to a client, showing the current executed amount in the CumQty field.
Tag
37
11
17

Tag name
OrderID
ClOrdID
ExecID

39

OrdStatus

150
55
59

ExecType
SymbolTimeInForce

14
151
38
54

CumQtyLeavesQty
OrderQty
Side

40

OrdType

6
126
60

AvgPx
ExpireTime
TransactTime

Description
OrderID of order. Set by Dukascopy FIX API
Identifier of order. Set by client
Unique OrderID of execution. Set by Dukascopy FIX API. For partially filled orders API
server sends execution report for each execution with unique ExecID & same OrderID
Following order states are supported:'2' Filled (if partly too)
'4' Canceled'8' Rejected'A' Pending New (Order has been received by FIX system but not yet
accepted for execution)'B' Calculated (sent to execution)
To get current status of order use OrdStatus. ExecType always set to 'I' - Order Status
Currency pair symbol. 'EUR/USD' for example'1' Good Till Cancel (GTC)'3' Immediate or Cancel (IOC) – the sort of Limit order'4' Fill or Kill (FOK) – execution without partial lls'6' Good till date (GTD)
Currently executed amount
Remained quantity for further execution
Initially requested order amount
Valid values:'1' Buy'2' Sell'7' Undisclosed (OrdStatus '4' Canceled or '8' Rejected)
Valid values:'1' Market'2' Limit'3' Stop (Stop-Limit if slippage is specified)'Q' Quote (Dukascopy specific BID/OFFER order)• in this case Tag 59 is not considered'Z' Only for instrument exposure closing
Price at which the trade was executed
Valid only if OrdType is Q (quote), or OrdType is '2'; '3' and TimeInForce = '6'
Time of execution report. Sets by Dukascopy FIX API

Copyright © 2021 by Dukascopy Bank SA

page 9Programming Guide for Dukascopy FIX API

Tag name
LastRpt
Requested
Account
1
Commission
12
CommType
137011 Slippage
Tag
912

103

OrdRejReason

544

CashMargin

Description
Only for reports with 'reject' state! Value 'FALSE ' will be set in case if the order
will be resubmitted
External account ID. This field is used only for multi accounts connection
Commission of execution
Commission type. Provided only type '3' - absolute, in account currency
Used only for Market, Limit and Stop orders. Defines the maximum allowed slippage
in pips. The minimum half a pip step is allowed (i.e. 3 or 3.5 is accepted, 3.2 is not accepted).
If slippage is not defined, the order will be placed based on a default slippage value
Relevant if 'OrdStatus ' is Rejected.
Valid values:'3' Order Exceeds Limit'99' Other
The field is set only in case of Margin Call trade. Valid value: '3' Margin Close

Example message:
8=FIX.4.4|9=221|35=8|34=246|49=DUKASCOPYFIX|52=20210616-13:06:59.564|56=SampleCompID|6=0.9394|11=1623848819377|12=0.01|13=3|14=1000|17=820323434|32=1000|37=820323434|38=1000|39=2|40=1|54=1|55=AUD/CAD|60=20210616-13:06:59.563|150=I|151=0|10=049|

5.2 New Order - Single (MsgType =D)
Market , Limit, Immediate or Cancel, Stop and Quote orders are supported. In case of “Limit” and“Quote” orders, an order will be executed when market price is equal or better than requested price.
“Market” order will be executed by the best available market price.
Tag
11
44

Tag name
ClOrdID
Price

40

OrdType59

TimeInForce

55
38
54

SymbolOrderQty
Side

Description
Unique identifier for the order as assigned by client
Price at which the trade was requested. Do not set for market orders
Valid values:'1' Market'2' Limit'3' Stop (Stop-Limit if slippage is specified)'Q' Quote (Dukascopy specific BID/OFFER order)• in this case Tag 59 is not considered'Z' Only for instrument exposure closing'1' Good Till Cancel (GTC)'3' Immediate or Cancel (IOC) – the sort of Limit order'4' Fill or Kill (FOK) – execution without partial fills'6' Good Till Date (GTD) – enables Expire Time setting for Stop Limit & stop orders
Currency pair symbol. 'EUR/USD' for example
Requested order amount
Valid values:'1' Buy (Bid for OrdType = Quote)'2' Sell (Offer for OrdType = Quote)

Copyright © 2021 by Dukascopy Bank SA

page 10

Programming Guide for Dukascopy FIX API

60
126
1
7011

TransactTime
ExpireTime
Account
Slippage

Time when this order request was initiated/released by the trader or trading system
Valid only if OrdType is Q (quote), or OrdType is '2';'3' and TimeInForce = '6'External account ID (Only for multi accounts. Ignored for a single connection)
Used only for Market, Limit and Stop orders. Defines the maximum allowed slippage
in pips. The minimum half a pip step is allowed (i.e. 3 or 3.5 is accepted, 3.2 is not accepted).
If slippage is not defined, the order will be placed based on a default slippage value

Example message:
8=FIX.4.4|9=140|35=D|34=240|49=SampleCompID|52=20210616-13:06:59.491|56=DUKASCOPYFIX|11=
163848819377|38=1000|40=1|54=1|55=AUD/CAD|60=20210616-13:06:59.491|10=168|
5.3 Order Cancel Request (MsgType = F)
Please note that only limit/stop orders in 'Pending New' status and quote orders in „Calculated” status
can be canceled.
Tag
37
41
11
1
55

Tag name
OrderID
OrigClOrdID
ClOrdID
Account
SymbolDescription
Unique OrderID of order that should be canceled
ClOrdID of the previous non-rejected order
Unique account ID of request
External account ID (Only for multi accounts. Ignored for a single connection)
Currency pair symbol. 'EUR/USD' for example

Example message:
8=FIX.4.4|9=117|35=F|34=248|49=SampleCompID|52=20210616-13:10:03.377|56=DUKASCOPYFIX|11=1623849003377|37=820323507|41=BUY|55=AUD/CAD|10=171|

5.4 Order Cancel/Replace Request (MsgType = G)
Use this message for updating order details. Please note that limit/stop orders in 'Pending New'status and quote orders in„Calculated” status can be updated only.
Tag
37
41
11
38
44
54
126
1

Tag name
OrderID
OrigClOrdID
ClOrdID
OrderQty
Price
Slide
ExpireTime
Account

Description
Unique OrderID of order that should be updated
ClOrdID of the previous non-rejected order
Unique account ID of request
New requested amount of order
New stop price at which the trade was requested
New side value
New expiration time
External account ID (only for multi accounts. Ignored for a single connection)

Copyright © 2021 by Dukascopy Bank SA

page 11

Programming Guide for Dukascopy FIX API

40

OrdType7011 Slippage

55
59

SymbolTimeInForce

Valid values:'1' Market'2' Limit'3' Stop (Stop-Limit if slippage is specified)'Q' Quote (Dukascopy specific BID/OFFER order)• in this case Tag 59 is not considered'Z' Only for instrument exposure closing
Used only for Market, Limit and Stop orders. Defines the maximum allowed
slippage in pips. The minimum half a pip step is allowed(i.e. 3 or 3.5 is accepted, 3.2 is not accepted). If slippage is not defined,
the order will be placed based on a default slippage value
Currency pair symbol. 'EUR/USD' for example'4' Fill or Kill (FOK)
Set this field only in case if you operate with „Fill or Kill” orders!

Example message:
8=FIX.4.4|9=161|35=G|34=247|49=SampleCompID|52=20210616-13:09:57.115|56=DUKASCOPYFIX|11=1623
848983133|37=820323507|38=3000|40=2|41=testoFIX_1623848969749|44=0.9|54=1|55=AUD/CAD|10=086|
5.5 Notification (MsgType = 'U1')
The message is used for client information about current account state.
Tag
7003

Tag name
NotifPriority

58
7004
1

Text
AccountName
Account

Description
Valid values:'0' INFO'1' WARNING'2' ERROR'3' ALERT
Text explanation of reason for rejection
SenderCompId of the client
External account ID (Only for multi accounts. Ignored for a single connection)

5.6 Account Info Request (MsgType = 'U7')
Client requests information about current account state. „Account” field in AccountInfoRequest
message is mandatory for multi user accounts; For a single connection blank AccountInfoRequest
message must be sent.
Tag
1

Tag name
Account

Description
External account ID (Only for multi accounts. Ignored for a single connection)

Example message:
8=FIX.4.4|9=70|35=U7|34=256|49=SampleCompID|52=20210616-13:13:45.552|56=DUKASCOPYFIX|10=004|
Copyright © 2021 by Dukascopy Bank SA

page 12

Programming Guide for Dukascopy FIX API

5.7 Account Info (MsgType = 'U2')
The message is used for client information about current account state.
Tag
7005
7006
7007
15
7004
1

Tag name
Leverage
UsableMargin
EquityCurrency
AccountName
Account

Description
Leverage of accountCurrent margin of accountCurrent equity of accountCurrency of accountSenderCompId of the client
External account ID (Only for multi accounts. Ignored for a single connection)

Example message:
8=FIX.4.4|9=137|35=U2|34=275|49=DUKASCOPYFIX|52=20210616-13:13:45.582|56=SampleCompID|15=USD|828=0|7004=SampleCompID|7005=100|7006=943983.23|7007=943983.23|10=001|

5.8 Instrument Position Info (MsgType = ‘U3’)
The message is used for client information about currently opened positions.
Tag
5
7008
7004
1

Tag name
SymbolAmountAccountName
Account

Description
Trading instrument
Current position amount (positive value for “long”, negative for “short”)
AccountName SenderCompId of the client
External account ID (Only for multi accounts. Ignored for a single connection)

Example message:
8=FIX.4.4|9=116|35=U3|34=286|49=DUKASCOPYFIX|52=20210616-13:15:52.939|56=SampleCompID|44=0.9393|55=AUD/CAD|7004=d_fixtest|7008=1000|10=042|

5.9 OrderMassStatusRequest (MsgType = ‘AF’)
Client requests orders in pending status and info about currently opened positions. Report will besent by server for each pending order and each position.
Tag
585
584
1

Tag name
MassStatusReqType
MassStatusReqID
Account

Description‘7' Status for all orders is supported only
External account ID (Only for multi accounts. Ignored for a single connection)

Example message:
8=FIX.4.4|9=94|35=AF|34=262|49=SampleCompID|52=20210616-13:15:52.905|56=DUKASCOPYFIX|584=1623849352905|585=7|10=154|

Copyright © 2021 by Dukascopy Bank SA

page 13

Programming Guide for Dukascopy FIX API

5.10 Activation Request (MsgType = ‘U5’)
This type of request should be implemented only for Multiple Accounts. It's used for information
purposes about the accounts under one accounts' group.

5.11 Activation Response (MsgType = ‘U6’)
This type of response is used only for Multiple Accounts. It's sent by Dukascopy as a reply to Activation
Request.
Tag
553
1

Tag name
MassStatusReqType
Account

Description
Username (login) of the accountExternal account ID

5.12 Overnight Report (MsgType = ‘U4’)
This message is sent each day after settlement, informing a client about overnights result.
Tag
1
15
7008

Tag name
Account
SymbolAmountDescription
External client's ID or Account ID in case of single user
Currency
Difference between secondary amounts of the two swap legs

Example message:
8=FIX.4.4|9=107|35=U4|34=890|49=DUKASCOPYFIX|52=20210616-21:23:41.753|56=SampleCompID|1=1400414|15=USD|7008=-1.88307719751|10=106

Copyright © 2021 by Dukascopy Bank SA

page 14