AlgoTraderAlgoTrader Documentation

Chapter 22. Adapters

22.1. Fix Interface
22.1.1. FIX configuration
22.1.2. FIX logging
22.1.3. FIX message persistence
22.1.4. FIX Drop-copy support
22.2. Session life-cycle events
22.3. Crypto Exchange interfaces
22.3.1. Crypto Exchange vs. Margin Trading
22.3.2. Custom currency mapping
22.4. Bloomberg
22.5. Currenex
22.6. DukasCopy
22.7. EzeSoft / Real Tick
22.8. Fortex
22.9. FXCM
22.10. IB Native Interface
22.10.1. IB Market Data Subscriptions
22.11. IB Fix Interface
22.12. JP Morgan
22.13. LMAX
22.14. Nexus Prime
22.15. PrimeXM
22.16. Quandl
22.17. QuantHouse
22.18. SocGen
22.19. Trading Technologies (TT)
22.20. UBS
22.21. Binance
22.22. Bitfinex
22.23. Bitflyer
22.24. BitMEX
22.25. Bitstamp
22.26. CoinAPI
22.27. Coinigy
22.27.1. Setup Instructions
22.28. CoinMarketCap

The following sections give a detailed overview of the different adapters available for AlgoTrader.

AlgoTrader uses QuickFix/J for it's Fix connections and currently supports FIX 4.2 and 4.4. Because FIX messages are not compatible between different version, the two distinct services Fix42OrderService and Fix44OrderService exist. Incoming messages are handled by their corresponding Fix42MessageHandler and Fix44MessageHandler.

To configure a Fix trading connection the following steps have to be taken care of:

  • Add the corresponding fix trading profile to the VM argument spring.profiles.active (e.g. cNXFix):

    -Dspring.profiles.active=live,pooledDataSource,cNXFix,embeddedBroker,html5,InfluxDB 
  • Add the fix session to /algotrader/core/src/main/resources/fix.cfg (Use the fix-template.cfg file as basis - do not delete the default section):

    [session]
    SessionQualifier=CNXT
    BeginString=FIX.4.4
    SenderCompID=xxx
    TargetCompID=CNX
    SocketConnectHost=dret-fix-ssl.currenex.com
    SocketConnectPort=443
    SocketUseSSL=Y
    Username=xxx
    Password=xxx
    ValidateIncomingMessage=N
    ResetOnLogon=Y
    Inactive=Y
  • Make sure there is an entry in the MySQL account table where the column ORDER_SERVICE_TYPE matches the type of the fix interface (e.g. CNX_FIX), the column SESSION_QUALIFIER matches the SessionQualifier specified in the file fix.cfg and the ACTIVE column is set to 1.

If market data is also received through a Fix interface the following items need to be added as well:

  • Add the corresponding fix market data profile to the VM argument spring.profiles.active (e.g. cNXFix):

    -Dspring.profiles.active=live,pooledDataSource,cNXMarketData,embeddedBroker,html5,InfluxDB 
  • Add the fix session to /algotrader/core/fix.cfg (an example file fix-template.cfg is provided in the same directory):

    [session]
    SessionQualifier=CNXMD
    BeginString=FIX.4.4
    SenderCompID=xxx
    TargetCompID=CNX
    SocketConnectHost=dret-fix-ssl.currenex.com
    SocketConnectPort=443
    SocketUseSSL=Y
    Username=xxx
    Password=xxx
    ValidateIncomingMessage=N
    ResetOnLogon=Y
    Inactive=Y
  • When making subscriptions add the FeedType corresponding to the Fix interface (e.g. CNX)

Important

Please make sure to have the setting Inactive=Y in both trading and market-data sections. Without this setting the fix session will be initialized before the remaining system has been fully initialized and might cause either trading or market data to malfunction.

For further information regarding QuickFix/J configuration please visit the QuickFix/J documentation

Per default Fix interfaces uses the following items to identify a particular instrument:

Options

Exchange IB_CODE

SecurityFamily CURRENCY

SecurityFamily SYMBOL_ROOT

Option STRIKE

Option TYPE

Option EXPIRATION

SecurityFamily CONTRACT_SIZE

Future

SecurityFamily CURRENCY

Exchange IB_CODE

SecurityFamily SYMBOL_ROOT

Future EXPIRATION

SecurityFamily CONTRACT_SIZE

Forex

SecurityFamily CURRENCY

Exchange IB_CODE

Forex BASE_CURRENCY

Stock

SecurityFamily CURRENCY

Exchange IB_CODE

Stock SYMBOL

Fund

SecurityFamily CURRENCY

Exchange IB_CODE

Index SYMBOL

All trading interface adapters generate session events, which enable the server engine as well as individual strategies to listen for and react to session events such as session being fully established or temporary loss of connectivity.

@Override

public void onChange(final SessionEventVO event) {
    switch (event.getState()) {
        case CONNECTED:
            // session connected but not yet authenticated
            break;
        case LOGGED_ON:
            // session connected and authenticated
            break;
        case DISCONNECTED:
            // session disconnected
            break;
    }
}

AlgoTrader provides several crypto currency exchange adapters which are based on REST, Web Socket or REST.

When trading crypto currencies it is recommended to update the following properties inside conf.properties. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

# the currency all portfolio balances will be calculated in
misc.portfolioBaseCurrency=BTC

# the number of digits all portfolio balances will be displayed with
misc.portfolioDigits=8

The Bloomberg interface supports Market Data, Historical Data as well as Reference Data.

The Bloomberg interface provides both synchronous connections and asynchronous connections. Asynchronous connections are generally used for live market data whereas synchronous connections are used for retrieval of historical data as well as retrieval of reference data.

If market data is received through the Bloomberg interface the following items need to be added:

Bloomberg uses the BBGID field of the Security table to identify instruments.

For further details on the Bloomberg interface please visit the Bloomberg Open API

The main features of the Currenex platform are

The Currenex implementation of the FIX/4.4 protocol has some peculiarities

Currenex uses the columns Forex BASE_CURRENCY and SecurityFamily CURRENCY to identify an instrument.

The DukasCopy interface supports Market Data as well as Order Processing.

Since the DukasCopy Fix Implementation does not follow the Fix Standard very closely, a few customizations had to be made:

DukasCopy uses the columns Forex BASE_CURRENCY and SecurityFamily CURRENCY to identify an instrument.

The DukasCopy Fix interface uses an SSL encrypted connection which is supported by QuickFix/J using Mina. In addition the DukasCopy interface requires username and password to be send with the Logon message. For this purpose the class DCLogonMessageHandler is used as an outgoing MessageHandler.

EzeSoft / RealTick provides connectivity to about 30 institutional and 10 retail brokers.

The EzeSoft / RealTick Fix interface currently supports only Order Processing.

The Fix Implementation of EzeSoft / RealTick is well conforming with the Fix Standard no customizations had to be made.

The IB Fix interface uses standard Fix instrument definitions mentioned at the end of section Section 22.1, “Fix Interface”.

Fortex uses almost vanilla Fix/4.4 protocol with a very customizations. It supports FX only.

Fortex uses the columns Forex BASE_CURRENCY and SecurityFamily CURRENCY to identify an instrument.

FXCM interface FIX/4.4 protocol does not deviate much from the standard but has some peculiarities about the way FIX sessions are established

FXCM uses the columns Forex BASE_CURRENCY and SecurityFamily CURRENCY to identify an instrument.

The native IB Interface connects to the local Trader Workstation (TWS) or IB Gateway instance and uses methods supplied by the IB client. The interface is fully capable of handling IB's Financial Advisor functionality like Sub Accounts, Account Groups and Allocation Profiles.

The IB interface supports Market Data, Historical Data, Order Processing, Retrieval of account information as well as Reference Data.

To configure an IB connection the following steps have to be taken care of:

  • Add the profile iBNative to the VM argument spring.profiles.active:

    -Dspring.profiles.active=live,pooledDataSource,iBNative,embeddedBroker,html5,InfluxDB 
  • Make sure there is an entry in the account database where the column ORDER_SERVICE_TYPE is set to IB_NATIVE) .

If market data is also received through the IB interface the following items need to be added as well:

  • Add the profile iBMarketData to the VM argument spring.profiles.active:

    -Dspring.profiles.active=live,pooledDataSource,iBMarketData,embeddedBroker,html5,InfluxDB 
  • When making subscriptions add the FeedType IB

The IB interface has the following options to identify a particular instrument:

  • CONID specified in the security table

  • Use instrument symbols and additional data depending on the instrument type:

    Options

    Exchange IB_CODE

    SecurityFamily CURRENCY

    SecurityFamily SYMBOL_ROOT

    Option STRIKE

    Option TYPE

    Option EXPIRATION

    SecurityFamily CONTRACT_SIZE

    Future

    SecurityFamily CURRENCY

    Exchange IB_CODE

    SecurityFamily SYMBOL_ROOT

    Future EXPIRATION

    SecurityFamily CONTRACT_SIZE

    Forex

    SecurityFamily CURRENCY

    Exchange IB_CODE

    Forex BASE_CURRENCY

    Stock

    SecurityFamily CURRENCY

    Exchange IB_CODE

    Stock SYMBOL

    Index

    SecurityFamily CURRENCY

    Exchange IB_CODE

    Index SYMBOL

    Combination

    SecurityFamily CURRENCY

    Exchange IB_CODE

    SecurityFamily BASE_SYMBOL

    Security CONID of each Component

    Component QUANTITY

In addition the following items apply to the IB Native interface

  • The IB Native interface uses the RT_VOLUME events to process incoming trade events

  • The IB Native interface propagates daily OPEN and CLOSE prices to strategies in case the following property inside conf-ib.properties is enabled. Alternatively the properties can be changed via Section 2.3, “VM Arguments”

    # enables emission of generic open and close ticks
    ib.emitOpenClose = true
  • The IB Native interface propagates VWAP prices to strategies in case the following property inside conf-ib.properties is enabled. Alternatively the properties can be changed via Section 2.3, “VM Arguments”

    # enables emission of generic VWAP ticks
    ib.emitVWAP = true
  • The IB Native interface expects orders to be sent with their order ids in ascending order. The Class IBOrderIdSynchronizer is responsible to make sure order ids are actually in ascending order. In case an order id is skipped the IBOrderIdSynchronizer will wait for up to maxOrderSyncTime milliseconds for the order with the correct order id to arrive.

  • The IB Native interface supports trading of tradeable / non-synthetic combinations by placing BAG orders through the IB interface.

  • The IB Native interface reports volBid, volAsk and vol in lots of 100 contracts for US equities. Please see the following page for further details on handling of Odd Lot Orders

For further details on the IB native interface please visit the IB API Reference Guide

In the traditional financial sector (excluding cryptocurrencies) market data is not free and requires market data subscriptions.

IB provides free 15min delayed data, but this will not be accessible through the IB API. In order to access both real time market data as well as historical data, a corresponding market data subscription has to be in place.

Market data can be accessed both through the IB paper trading account as well as the live trading account.

To get a market data subscriptions one has to login to the IB account management with the live trading account. Then follow these steps:

  1. Select Settings / User Settings in the menu on the left. Then select Market Data Subscriptions on the right

  2. Then click on the icon next to Current Subscriptions

  3. Then select the region (e.g. North America)

  4. On the next screen individual market data subscriptions can be selected




Typical market data subscriptions are:

  • IDEAL FX: free Forex market data

  • NASDAQ (Network C/UTP): live market data for NASDAQ listed equities

  • NYSE (Network A/CTA): live market data for NYSE listed equities

  • US Securities Snapshot and Futures Value Bundle: live market data for US futures and snapshot data for US equities (AT cannot process snapshot data, so in addition NASDAQ and NYSE has to be subscribed as well)


To use these market data subscriptions through the paper trading account follow these steps:

  1. Select Settings / User Settings in the menu on the left. Then select Paper Trading Account on the right

  2. Then select Yes next to Share real-time market data subscriptions with paper trading account

  3. Then Select the username whose market data you want to share. This will share the market data subscriptions of the live account with the paper trading account.



Note

In case no market data arrives through the IB interface it is usually best to login to InteractiveBrokers Trader Workstation (TWS) as there are usually warning messages that indicate what might be the issue

The IB Fix Interface provides the same Order Management features as the IB Native Interface. However Market Data is not available through this interface.

The interface is fully capable of handling IB's Financial Advisor functionality like Sub Accounts, Account Groups and Allocation Profiles.

For further details on the IB Fix interface please visit the IB FIX/CTCI Users' Guide

The IB Fix interface uses standard Fix instrument definitions mentioned at the end of section Section 22.1, “Fix Interface”.

The JP Morgan Fix interface supports Order Processing only.

As the JP Morgan Fix Implementation is well conforming with the Fix Standard no customizations had to be made

The JP Morgan Fix interface uses standard Fix instrument definitions mentioned at the end of section Section 22.1, “Fix Interface”.

Supports only a limited number of securities, mainly Forex

LMAX implementation of the FIX/4.4 protocol has some peculiarities

LMAX uses the column LMAXID of the security table to identify an instrument

Nexus Prime is a MetaTrader MT4 FIX interface provided by IS Risk Analytics. The Nexus Prime interface uses Fix 4.4 and it supports FX only. Due to the underlying MetaTrader MT4 a few limitations apply.

  • Market Data subscriptions cannot be cancelled

  • Orders cannot be modified, instead one needs to cancel the current order first and then resend a new one.

  • Buy limit orders need to be placed below the market price. Sell limit orders need to be placed above the market price

  • Buy stop orders need to be placed above the market price. Sell stop orders need to be placed below the market price.

  • Minimum trade size allowed on most currency pairs is .01 lots which is 1000 notional

Nexus Prime uses the columns Forex BASE_CURRENCY and SecurityFamily CURRENCY to identify an instrument.

The PrimeXM FIX/4.4 interface implementation follows the Fix Standard closely, but uses MassQuote messages for conveying the market data. Each MassQuote message has to be acknowledged by the FIX client.

Only Forex instruments are supported by the PrimeXM Fix Interface. Order modifications are not supported.

Quandl is a public service that provides a wide range of financial, economic and alternative data. It is mostly end of day data but also some intra-day(e.g. hourly) data. To find out if they have what you are looking for, check their data products page. AlgoTrader allows downloading historical data from Quandl. For more information about Quandl please have a look at the Quandl Docs/Help.

Data on Quandl is divided into databases. Each database contains multiple datasets. For instance EOD database contains end-of-day data for all publicly-traded US stocks. Each database/dataset pair is uniquely identified by database_code/dataset_code pair. For instance EOD/AAPL is the globally unique code for the AAPL stock dataset within the EOD database. The Quandl database browser can be used to find suitable databases for desired instrument type, region and data type.

The QdlHistoricalDataService is integrated with the AlgoTrader Historical Data Download and needs to be enabled by specifying the qdlHistoricalData Spring profile (see section Section 19.3, “Historical Data Download”). The QdlHistoricalDataService transforms retrieved Quandl data into AlgoTrader bars. Transformation rules between the Quandl data format and AlgoTrader Bar format are defined in the file quandl.yml. By default the file quandl.yml already contains the transformation rules for most commonly used Quandl databases. Additional transformation rules can be added to the file as needed:

EOD: 1
    barSize: DAY_1 2
    columnMapping: 3
        dateTime: Date
        open: Open
        high: High
        low: Low
        close: Close
        vol: Volume

1

The Quandl database code

2

barSize supported by the Quandl database (e.g. DAY_1 or MIN_1)

3

Column mappings between Quandl data fields and AlgoTrader BarVO fields

The relevant properties for the Quandl adapter are defined inside the file conf-qdl.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
qdl.apiKey = ATVxxxxxxxxxxxxx

To use the QdlHistoricalDataService please replace the property qdl.apiKey with the API Key that can be retrieved through the Quandl Account Settings.

In terms of historical data download a mapping between the Quandl database and the SecurityFamily entity is defined by the quandl_database field in the security_family table. Similarly a mapping between the Quandl dataset and the Security entity is defined by the quandl_dataset field in the security table. AlgoTrader sample data files (samples/db/mysql/mysql-data.sql and samples/db/mysql/h2-data.sql) already contain quandl_database/quandl_dataset values for all sample security families and most sample securities.

The QuantHouse adapter is based on the QuantHouse ultra low latency market data feed QuantFEED. The QuantHouse adapter supports live Market Data.

If market data is received through the QuantHouse interface the following items need to be added:

QuantHouse uses the Exchange MIC and Security SYMBOL fields to identify instruments.

For further details on the QuantHouse interface please contact QuantHouse

The SocGen FIX/4.2 interface supports Order Processing only.

The SocGen Fix Implementation follows the Fix Standard closely, but some minor customizations according to the 'SocGen FIX Rules of Engagement' had to be made. Additionally exchange specific restrictions rules defining the allowed order type / TIF combinations were added.

Only Future instrument orders are supported by the SocGen Fix Interface.

Supports a wide range of future and option contracts tradeable at multiple venues / exchanges.

The UBS Fix interface supports Order Processing for futures and options only.

As the UBS Fix Implementation is well conforming with the Fix Standard no customizations had to be made

The UBS Fix interface uses standard Fix instrument definitions mentioned at the end of section Section 22.1, “Fix Interface”.

Binance is a cryptocurrency exchange. Please see the API reference page for the technical details.

Binance provides Java library for interacting with Binance API. It supports REST requests to endpoint providing orders functionality, account data and reference data. Support for market data is done using WebSocket API.

The relevant properties for the Binance adapter are defined inside the file conf-bnc.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bnc.apiKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"API Secret"}
bnc.apiSecret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"Boolean","label":"if true import all currencies, otherwise only those defined in ch.algotrader.enumeration.Currency"}
bnc.importAllPairs = true           

A Binance account is necessary in order to use Binance adapter. Unique apiKey and apiSecret settings must be set to the actual values (either in the properties file or by setting a VM argument)

Note

Binance is very time sensitive , i.e. if your computer is ahead of the Binance system clock, the API might reject your orders with an exception similar to

com.binance.api.client.exception.BinanceApiException: Timestamp for this request was 1000ms ahead of the server's time

To prevent these issues, we suggest synchronizing your system clock with an internet reference time using e.g. this time sync tool.

Binance does not support margin trading.

AlgoTrader currently support market, limit and stop limit orders on Binance.

Bitfinex is a cryptocurrency exchange. The Bitfinex adapter provides order execution, market data, reference data and account data functionality. Please see the Bitfinex API reference page for technical details about the supported features.

The relevant properties for the Bitfinex adapter are defined inside the file conf-bfx.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bfx.apiKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"API Secret"}
bfx.apiSecret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"Integer","label":"REST API Rate Limit Milliseconds"}
bfx.rateLimit = 1500

#{"type":"Integer","label":"API-level constant'}
bfx.scale = 5

#{"type":"Boolean","label":"if true import all currencies, otherwise only those defined in ch.algotrader.enumeration.Currency"}
bfx.importAllPairs = true

A Bitfinex account is necessary in order to use Bitfinex adapter. Unique apiKey and apiSecret settings must be set to the actual values (either in the properties file or by setting a VM argument)

AlgoTrader supports Bitfinex exchange and margin trading.

Market, limit, stop and stop limit orders are supported. For exchange account trading, different order types are used (exchange market, exchange limit and exchange stop).

Note

AlgoTrader does not currently support order modifications through Bitfinex.

Bitflyer is a cryptocurrency exchange. The Bitflyer adapter supports order execution, market data, reference data and account data functionality. Please see the Bitflyer API reference page for technical details.

Note

At this point (April 2018), Bitflyer does not yet support cross-border trading, so trading vs. USD is only possible with a US account.

The relevant properties for the Bitflyer adapter are defined inside the file conf-bfl.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bfl.apiKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"API Secret"}
bfl.apiSecret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"PubNub Subscribe Key"}
bfl.pubNubSubscribeKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"Integer","label":"REST API Rate Limit Milliseconds"}
bfl.rateLimit = 1500

#{"type":"Boolean","label":"if true import all currencies, otherwise only those defined in ch.algotrader.enumeration.Currency"}
bfl.importAllPairs = true           

A Bitflyer account is necessary in order to use Bitflyer adapter. Unique apiKey, apiSecret as well as market data subscription key settings must be set to the actual values (either in the properties file or by setting a VM argument)

We support Bitflyer margin and exchange trading.

Bitflyer uses different instruments for exchange and margin trading (see Bitflyer margin trading.)

  • Exchange: BTCJPY with security.DESCRIPTION "BTCJPY"

  • Margin: BTCJPYwith security.DESCRIPTION "FX_BTCJPY"

Bitflyer supports market and limit orders.

Note

At this point (July 2018), Bitflyer does not support order modifications.

BitMEX is a cryptocurrency futures exchange. The BitMEX adapter provides order execution, market data, reference data and account data functionality through REST and WebSocket API. Please see the API reference page for technical details about the supported features.

The relevant properties for the BitMEX adapter are defined inside the file conf-bmx.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bmx.apiKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"API Secret"}
bmx.apiSecret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"Integer","label":"REST API Rate Limit Milliseconds"}
bmx.rateLimit = 1000

#{"type":"Integer","label":"API-level constant'}
bmx.balanceScale = 8

A BitMEX account is necessary in order to use the BitMEX adapter. Unique apiKey and apiSecret settings must be set to the actual values (either in the properties file or by setting a VM argument)


The contract size is defined in the CONTRACT_SIZE field of the security_family table. It has to be updated regularly for contracts with a variable contract size, which can be done either manually or through the BitMEX Reference Data Service.

BitMex is a Futures exchange, so only margin trading is supported.

AlgoTrader support market, limit, stop and stop limit orders.

Bitstamp is a cryptocurrency exchange. Please see the API reference page for the technical details.

Order and market data related functionality is provided via FIX/4.4 protocol. Account data and reference data is provided via REST API.

Bitstamp FIX/4.4 interface follows the standard closely, but offers only one session for both market data feed and trading operations. Bitstamp market data supports only limited number of cryptocurrency (Forex) securities. Order modifications are not supported. For more information about the Bitstamp FIX specification please have a look at the Bitstamp public FIX interface.

The relevant properties for the Bitstamp adapter are defined inside the file conf-bts.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
bts.apiKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"API Secret"}
bts.apiSecret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"String","label":"Customer ID"}
bts.customerId = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

#{"type":"Integer","label":"REST API Rate Limit Milliseconds"}
bts.rateLimit = 1500

#{"type":"Boolean","label":"if true import all currencies, otherwise only those defined in ch.algotrader.enumeration.Currency"}
bts.importAllPairs = true

A Bitstamp account is necessary in order to use Bitstamp adapter. Unique apiKey and apiSecret settings must be set to the actual values (either in the properties file or by setting a VM argument)

Bitstamp does not support margin trading.

AlgoTrader supports market, limit and stop orders.

At this point (July 2018), Bitstamp does not support order modifications.

CoinAPI is a market data gateway to multiple crypto exchanges. CoinAPI provides historical and live market data. It also provides reference data for the supported instruments, however it doesn't provide trading related functionality. Please see the API reference page for the technical details.

Historical data is available down to 1 second bars. Historical data availability varies by currency. Up to 100 daily requests can be placed for free. Consult their pricing if you require more.

Instruments and exchanges must have CNPID value setup in security and exchangedatabase tables.

The relevant properties for the CoinAPI adapter are defined inside the file conf-cnp.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"API Key"}
cnp.apiKey = XXXXXXXXXXXXXXXXX

#{"type":"Integer","label":"REST API Rate Limit Milliseconds"}
cnp.rateLimit = 1500

#{"type":"Integer","label":"API-level constant'}
cnp.scale = 5

#{"type":"Boolean","label":"if true import all currencies, otherwise only those defined in ch.algotrader.enumeration.Currency"}
cnp.importAllPairs = true

#{"type":"String[]","label":"can contain values: trade, quote, book20"}
cnp.websocketUpdates = trade,quote

Unique apiKey and apiSecret settings must be set to the actual values (either in the properties file or by setting a VM argument)

Coinigy provides connectivity to 45+ of most popular cryptocurrency exchanges allowing to trade hundreds of different crypto currencies. The Coinigy Interface connects to the Coinigy API endpoints via REST and Socket Cluster protocols.

The Coinigy interface supports Market Data, Order Processing, Retrieval of account information as well as Reference Data.

Currently the following limitations and known issues exist:

Coinigy uses the columns Security CNGID and Exchange CNGID to identify an instrument.

For further details on the Coinigy interface please visit the Coinigy API Documentation

To setup a connection to Coinigy the following steps have to be taken:

  • Sign-up for a Coinigy account on Coinigy Sign up

  • Enable two factor authentication (2FA) on the account following the 2FA Instructions

  • In the API accounts settings add the API keys from all of the exchanges where an account is setup according to these Instructions

  • In the account preferences generate a new Coinigy API key and Secret Key set it inside conf-cng.properties

  • In the account preferences click the button 'Click to reveal my Private Channel ID (WebSocket API)' and set the Private Channel ID inside conf-cng.properties

The relevant properties for the Coinigy adapter are defined inside the fileconf-cng.properties where they can be changed. Alternatively the properties can be changed via Section 2.3, “VM Arguments”:

#{"type":"String","label":"WSS Private Channel"}
cng.wssPrivateChannel = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

#{"type":"String","label":"API Key"}
cng.apiKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

#{"type":"String","label":"API Secret"}
cng.apiSecret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

#{"type":"String","label":"CNG reverse exchanges"}
cng.reverseExchanges = BITS,BTCC,PLNX

#{"type":"String","label":"CNG Default Exchange Codes"}
cng.defaultExchangeCodes = PLNX,BITF,KRKN,GDAX,BTCE,OK,BTRX,BT38,BITS,HUOB

# default exchanges/feed types to use for market data.
#{"type":"String","label":"Default market feeds"}
misc.defaultMarketFeeds=BMEX:CNG,OKEX:CNG,BINA:CNG

In order to populate the database with Coinigy Accounts, Exchanges, Security Families and Securities run the ReferenceDataStarter with cNGReferenceData spring profile enabled and program argument: all. For further details please visit Chapter 20, Reference Data.

CoinMarketCap - Cryptocurrency Market Capitalizations is a website providing information about all existing crypto currencies and exchanges. The CoinMarketCap interface connects to the website via HTML and REST API.

The CoinMarketCap interface provides the publicly available daily historical data and reference data for all listed crypto currencies. No account is necessary in order to use the CoinMarketCap adapter.