We are happy to announce that XTRD’s OEMS for digital asset trading is now available in the Equinix TY8 location – Tokyo, Japan!
We have connectors with 40+ exchanges, including these ones:
- Huobi Global
We are happy to announce that XTRD’s OEMS for digital asset trading is now available in the Equinix TY8 location – Tokyo, Japan!
We have connectors with 40+ exchanges, including these ones:
Article by Serg Gulko, Co-Founder & CEO at XTRD
In this article, I would like to address the most common questions we received about XTRD OEMS for digital assets trading.
OEMS, sometimes O/EMS, stands for Order and Execution Management System. Initially, it was two separate software types – OMS and EMS which were merged into a single system over time. We live in a time of consolidation and modern OEMS systems are capable (sometimes) of doing much more than before, including positions management orchestrating the settlement process.
OEMS is in charge of many things – orders entry and execution through different liquidity providers, analytics, market data streaming and charts, transactions cost analysis, and so on. The system can be accessed by humans as well as programmatically through APIs such as FIX.
Unlike its peers from established markets like FX, a big part of crypto OEMSs is dedicated to connectivity management. Almost every liquidity provider in the FX space understands FIX; specifications have not changed for years and a TCP/IP connection established on Monday can be disconnected in about one week. This does not happen in crypto which adds some “spice” to the process and extra complexity.
Of course, you can link the database layer, implement your own mechanisms to deal with dead WebSockets, tune connectors code (in many cases, the quality is far from ideal and many things can and should be improved), add accounts support, and so on. Good job! You just built your own OEMS system.
I see libraries as bricks, while OEMS is an unfinished house. Add hardwood floors, furniture, doors, lights, and a fence – and you’ll get a trading platform, market-making algo, or something different but something that can be used by people. Bricks are important but you can’t live surrounded by just them.
Disclaimer: in XTRD OEMS we do not use any third-party normalization libraries to communicate with crypto exchanges. Everything is built in-house to ensure the best performance.
In most cases, it’s beneficial to integrate ready-to-use OEMS unless you would like to build your own and become a vendor.
Of course, there are many factors to consider, such as flexibility, functionality, latency, geographical location, support, prices, and even team behind the scene but I can assure you that it’s always possible to find a compromise. There are many solutions on the market, some good, some bad but they can save the most valuable resource – time.
Different systems offer different sets of functions. Below is what XTRD OEMS offers to accelerate crypto trading.
We use FIX 4.4 for both market data and trading sessions. It means that, for example, quotes from Binance will look the same as quotes from Coinbase Pro. The trading process also will look identical although exchanges are completely different.
XTRD OEMS is interconnected with major crypto exchanges in the US, Europe, and Asia. All trading operations on different venues can be done through a single TCP/IP connection (or can be spread).
Information about clients’ orders is replicated and constantly updated on our servers. Each trade confirmation or/and cancellation dynamically changes the representation of orders which we store in memory.
We store every order sent through our system and every execution report received. There is no ‘data retention period,’ everything that gets in, remains there. Information about trading activities includes exchange-assigned IDs, timestamps, trade prices and sizes, and also fees paid.
XTRD OEMS for crypto is designed in a way that allows a single organization to have multiple independent resources, for example, trading desk accounts with their own connections to exchanges, balances, and separated FIX sessions for trading.
Such separation also helps build trading platforms on top of the XTRD stack – accounts are segregated and do not interact with each other.
There is no common standard for naming convention. Each exchange lives to create something new and unique (and they have a wild imagination), so we built and maintain our own directory that covers spot and derivatives markets.
We carefully monitor outgoing connectivity statuses, and if something goes wrong (and this happens relatively often, unfortunately, due to current infrastructure development) we notify clients, disable trading on a particular destination, and start checking once it returns to normal. Once we connect again, we handle complicated synchronization procedures that include checking all open orders, trading history, and position changes.
XTRD OEMS has a dedicated demo environment that can be used to test integration without putting real money at risk. The Demo Environment fully replicates our production services, including market data streams and management API.
In addition, to FIX API for trading and market data, we offer REST-based API to manage assets of your organizations – accounts, connectivity to exchanges, FIX sessions, and access rights. This API also can be used to fetch trading history, positions, and even open orders.
Binance is one of the largest cryptocurrency exchanges in the world, responsible for $7.7 trillion crypto exchange volume in 2021. It was founded in 2017 by Changpeng Zhao, who previously worked for Blockchain.info and as CTO of OKCoin.
XTRD is an institutional-grade OEMS for digital assets trading. We provide access to major crypto exchanges through the unified FIX API.
In this article, we would like to demonstrate how to build a small yet powerful scalping application that trades on the leading cryptocurrency exchange – Binance.
The bot will be connected to Binance through XTRD FIX API to receive real-time normalized market data and to place/cancel orders.
You can reuse this source code in your projects free of charge.
Disclaimer: the bot is not a ready-to-use solution because it lacks risk controls and proper positions management. Although our R&D shows promising performance, do not expect to achieve the same results.
Before we dive into the technical part, it’s worth explaining the logic behind the given trading bot.
Scalping is a momentum-based trading style where positions hold for minutes or even seconds and then sell for profit (or small loss… a sacrifice to Mr. Market). When performed manually, it requires self-discipline, the ability to handle stress, make quick decisions, and act accordingly.
Renko chart is one of the technical analysis tools that help reduce market noise and identify market trends more precisely. One of the authors of this article was introduced to Renko about 15 years ago and fell in love with it.
To construct a single brick on a chart we should perform several simple steps:
Here is our trading logic:
Simply put, it is the good old “buy low, sell high” principle computerized and applied to crypto markets through XTRD FIX API.
The bot itself contains several main components:
To make this technical-enough material more fun, we decided to build a small user interface to plot Renkos bricks and executions.
Since all high-level details of implementation were discussed, let’s get started with the implementation part.
To build Renko charts we need to establish a connection to a service called XTRD MD Feeder. It is responsible for disseminating real-time normalized market data from Binance (and other crypto exchanges) using FIX protocol. In comparison with WebSockets, FIX is faster and more reliable because it runs on top of a pure TCP/IP stack and has no additional intermediary layers.
Using FIX protocol, you can easily subscribe to receive updates for one or many trading instruments available on Binance such as BTC/USDT, ETH/USDT, and so on. It is possible to specify what sort of information you’ll need – bids, asks, and/or trades. Another big advantage is that market data itself comes in incremental updates. This means that you receive only actual changes of the entire orders book (like 3-4 levels) but not a full book every time. This is not a big issue with Binance which already streams data as a delta (difference between the previous and current state) but can be extremely helpful with other crypto exchanges XTRD supports.
There are three major messages defined by FIX standard and implemented inside XTRD that help manage your crypto market data streams – MarketDataRequest, MarketDataSnapshotFullRefresh, and MarketDataIncrementalRefresh. As it is easy to understand from their names, MarketDataRequest is used to manage your subscription (start or stop data streams), MarketDataSnapshotFullRefresh is used by the server to transmit the entire book, and MarketDataIncrementalRefresh is sent by the server when data (price or side) in the particular orders book changed.
The market data management workflow is simple – once the application established a connection to XTRD OEMs over the FIX, it sends MarketDataRequest to subscribe to all updates on BTC/USDT (or another selected symbol) on Binance.
If the request was successfully processed, XTRD OEMS for digital assets trading responds with a MarketDataSnapshotFullRefresh message that contains all levels for BTC/USDT orders book. The application uses this data to initiate the book and starts waiting for incoming MarketDataIncrementalRefreshes that carry small (and sometimes not very small) delta changes. These changes have to be applied to the book (delete levels, update sizes on a particular level, add new prices). Once a book is updated, the component responsible for Renko’s generation will check if the conditions to create a new brick are met or if the price is still within the interval.
Now, when we have a working market data connection and Renkos charts, it’s time to start trading on Binance using FIX API.
FIX specification contains plenty of different messages (commands and responses) that cover pretty much everything in a typical trade lifecycle starting from initiation to ending with trade confirmation and settlement. XTRD OEMS system allows managing orders (get all, place, cancel, replace) and viewing positions through the unified FIX API.
When it comes to trading, there are three major messages – NewOrderSingle, OrderCancelRequest, and ExecutionReport.
NewOrderSingle is used to initiate an order. The message allows specifying different order characteristics, such as side (e.g. BUY), size, type (e.g. LIMIT), symbol, time in force (e.g. Good Till Cancel), among others.
Below is a textual representation of the raw FIX request to buy 0.001 BTC for USDT at Market on the Binance.
In many cases, the server interacts with clients over ExecutionReports. This message is used to indicate changes of your orders over time – was it accepted or rejected, canceled, or executed, and if executed, what are the price and size?
Each message has clear status, a clear ID, and a timestamp associated with it.
Many exchanges have their own workflows. XTRD OEMS for digital assets trading helps normalize these statuses and make them identical across all supported platforms:
Our demo application utilizes only two simple commands – NewOrderSingle (to place a new order) and OrderCancelRequest (to cancel an order we don’t need anymore).
Another useful command is OrderCancelRequest. It is used to initiate the cancellation of a pending order or the outstanding amount of a partially filled order.
Below is a sample of FIX-based OrderCancelRequest to cancel a pending order on Binance:
Our demo application will send requests to open an order (using NewOrderSingle) and to cancel it (using OrderCancelRequest) over the FIX to Binance. The server will notify us (using ExecutionReports) in real-time about any status changes of our order(s).
In real life, it’s always a good idea to separate business logic that makes decisions about entering or exiting the market from orders management. This component is usually complex and covers a vast array of scenarios of what can happen with orders starting from regular behavior when everything goes as expected and ending with different doomsday scenarios.
For the sake of simplicity, in this sample, we decided to use oversimplified orders management which also handles incoming market data-related events (OMS.java).
Below is the video of the working system (replayed with 50х speed):
Building a successful trading system is a challenging task where you must overcome many obstacles. Our goal is to make sure that the connectivity between your application and target exchange (or exchanges) will not become one of these blocking factors. By using XTRD OEMS for digital assets trading, you can easily build a reliable system that can operate around the clock. Connect to our FIX API to trade on Binance or many other exchanges and/or to receive real-time normalized market data. Focus on your business and let XTRD be your ‘pipes and plumbing’ provider!
Any feedback is highly appreciated!
We are happy to announce that from now Bybit is available through our FIX API.
XTRD OEMS for digital assets trading allows receiving normalized market data and actively trading on Bybit’s Spot, Futures, Perpetual Futures, and USDT-based Futures markets using unified FIX 4.4 end-point.
In order to cover dynamically growing crypto derivatives markets, we made a decision to change the naming convention for perpetual swaps, futures, and options.
Starting from October 01st, 2021, the new schema will be in effect in both NY4 and LD4 locations.
The new schema will follow next rules:
|Security Type||Base Asset||Quote Asset||Example|
Base Asset is actually the contract bought or sold.
Quote Asset indicates what asset will be used as a collateral. It could be anything starting from BTC, ETH, followed by stablecoins such as USDT, or even fiat like USD.
By XTRD’s Co-Founder and CTO Serg Gulko
Among many technical questions we receive, the latency-related group definitely stands out. Having deep HFT roots, I fully share concerns about this topic. Back in the day, building strategies for FX markets, we were choosing one CPU family over the other, preferring to use switches and routers of certain non-mass-market brands, install and tune very specific network cards, and so on. By the way, we replicated all this in the XTRD eco-system, that is why our NY4 location is equipped with Aristas and Exablaze servers!
But, of course, all these optimizations should be made only after your code is tuned to perfection. There is no economical sense of burning thousands of dollars on expensive hardware toys while you might have a bigger problem and it’s closer than you think.
We’ve been consulting several so-called “crypto-first” prop trading shops who bought absolutely top of the line/high cost servers and rented private internet lines from Avelacom (by the way, we also use Avelacom for certain destinations) to shave 4-7 ms of network-added latency. But! And here comes the best part – they had plans to use the CCXT library to trade. Don’t get me wrong, CCXT is a great library and I personally do respect the Open Source community but CCXT is not about HFT! So the fund guys win 7 ms by using high end hardware and private networks but lose sometimes up to 200 ms by using the wrong software.
Why do I think XTRD can do any better? One of our main focuses was – and still are – lowering latency in all possible ways. We analyze exchanges’ APIs, measure execution times, and build our connectors in order to notify clients as soon as possible when something happens.
Let me give you an example. Bittrex has a REST API to submit orders and an event-driven notification channel built on top of the terrible Microsoft SignalR stack. SignalR, in its turn, provides information in “orders” and “executions” channels. Data from the “executions” channel is more informative and useful (at least from our standpoint) but sometimes it comes with 300 (!) ms delay after similar, but less granular, updates in “orders”. What is really funny is that initial responses over the REST API come (sometimes, not always, which makes it even more interesting) faster than confirmations through SignalR. We know all these nuances and our connectors are capable of dealing with such situations. Of course, it creates certain complexity and non-linear logic but this is what we do for living.
Another example – when you cancel an order on Binance, you can rely on WebSocket notifications (which is a very convenient way) but in many cases, the REST API gets you a faster response. How fast? 10 ms! So you’ll know that your order has been canceled 10 ms faster and act on it accordingly. In the HFT world 10 ms is almost an eternity.
Each exchange has such “Easter eggs” and we know many of them. XTRD combines powerful hardware with a software layer, optimized to “shave” 10 ms here and 45 ms there. If you are committed to win, everything matters – your algo, the way it is coded, servers to run it, the right network to communicate, and a reliable partner to execute. Cut these latencies with XTRD, join the club!
We are happy to announce that XTRD’s OEMS for digital asset trading is now available in the Equinix LD4 location – London, UK!
The main reason we did this is to provide access through our low-latency FIX API to major derivative and spot trading exchanges, located in the EU and nearby.
In LD4 we offer the same set of connectivity options as in NY4 – cross-connection, co-location, and VPS connectivity through our partners.
Based on trades we observe, most of the work in the infrastructure and API development by digital asset exchanges lies in the area of derivatives and margin trading.
Binance introduced several new API end-points to manage BUSD loans.
Sub-accounts also got a new boost with these calls:
OKEx’s push towards a unified account structure is a great development that turned into a small technological drama.
Unified Accounts allow clients to use the same API keys and balances to trade on spot and derivative markets. In theory, it makes traders’ lives easier so they don’t have to transfer assets back and forth from wallet to wallet. From anintegration standpoint, it’s a very practical move because with V5 API we should care only about a single API key pair and connectivity.
In reality, this transition turned into a small mess – V3 and V5 keys were incompatible, many integrations stopped working, and V3 API keys creation moved into manual mode with up to three days of waiting time.
On Feb 28, Huobi stopped legacy v1 WebSockets. Shiny v2 with features such as client’s assigned order id, extended account, order, and balance update channels are waiting for integrators to pick it.
Disregard all advances in technologies, people still tend to make human-related errors. Fat Finger is a well-known but still often occurring situation. It does not spare anyone – crypto traders or respectful institutional players such as Citigroup (search for the recent $900M payout of Revlon debt).
BitMEX is the place where traders make a fortune or become broke in a blink of an eye. In February, BitMEX introduced Fat Finger protection:
QuantInsti describes itself as a company that provides innovation and solutions to bridge the gap between finance and technology in the changing phase of the industry. It serves individuals, businesses, exchanges, data providers, brokers, and other technology providers to achieve their common goal of excelling in Quant & Algo trading. QuantInsti provides both paid and free services to the industry.
Free services include webinars, blogs, tutorials, and trading models, algorithmic trading workshops, events, and modules for exchanges and industry. One of the most interesting and useful resources provided by QuantInst for free is their quant & algo trading blog. You can find a great selection of high-quality articles that can be a great source of information on trading for beginners and experienced traders.
Hacker Noon is one of the most popular blogging platforms “built for technologists to read, write, and publish”. It is an open international community of 15,000+ contributing writers publishing stories and expertise for 3,000,000+ curious and insightful monthly readers.
Hacker Noon has a relatively small number of articles on algorithmic trading, but all of them are very professionally written – 7 of them are among Hacker Noon top stories, which means that these articles were highly rated among this huge community of IT professionals. Take a look at stories with the “algotrading” tag and see for yourself.
According to Quantpedia’s website, their mission is “to process financial academic research into a more user-friendly form to help anyone who seeks new quantitative and algorithmic trading strategy ideas”.
A new blog post for Premium users is created once a new strategy is added into Quantpedia. Members can see all of a strategy’s characteristics and use the Screener and visualization tools to compare it to other Quantpedia strategies. All new academic research papers related to already existing Quantpedia Premium strategies are also published on their blog, but those blog posts are visible only for Premium users. Occasionally, they find academic papers related to common quantitative trading strategies. Such papers are usually described on their free blog.
Quantifiable Edges is a website founded by Rob Hanna, a full-time market professional since 2001. He first began publishing his market views and research in 2003. From 2003 to 2007 his column “Rob Hanna’s Putting It All Together” could be found twice a week on TradingMarkets.com. In 2008 Rob began Quantifiable Edges.
This resource has been publishing quantitative research, systems, and trading ideas since 2008. Quantifiable Edges also provides unique courses for longer-time market timing and quant-based swing trading, but what you can get for free is a truly great selection of articles written by Rob Hanna himself.
Cesar Alvarez, the founder of Alvarez Quant Trading, spent nine years as a professional market researcher for Connors Research and TradingMarkets.com. Cesar has been at the forefront of stock market research, having developed a number of successful trading systems now used by numerous investors and fund managers in the United States and internationally.
Most of his posts are based on the research he is doing for his own personal trading. Check out his blog where he tests trading ideas that readers and Cesar have. The primary focus is on stocks and ETFs with a hold range of a couple of days to several months. You can get spreadsheets of the results and more. Worth mentioning is that he also posts results that did not work out. “Understanding what does not work is every bit as important as knowing what does” – Alvarez says.