?> QuantXpress – Deliver high performance automated trading and connectivity solutions



Core Concepts


This section covers the basic terminology and concepts required to understand how BlitzTrader works. Once you understand the core concept, it’s easy to use BlitzTrader API for the development of proprietary Strategies, Exchange adapters and trading tools within the eco-system.

Strategy

Strategies are algorithmic trading programs defining set instruction or rules for entering and exiting trades seeking an alpha opportunity, manage market impact or optimize risk.
The developer implements the entry/exit rules based on his/her own knowledge and hypothesis, and the strategy will automatically place the trades in real-time. The BlitzTrader Strategy development API provides environment to build rule based strategies to monitor real-time prices, submit, cancel or modify orders based on market data events, receive order and fill updates and have access of positions and real-time trade statistics. The Strategy development framework completely decoupled the core strategy business logic from complex underneath software managing straight through processing and provides cleaner separation for you to focus only on your core strength trading and research.
The quant developers leverage existing tools like Visual Studio.NET IDE and Mocrosft.NET programming language to develop strategies using BlitzTrader API. Visual Studio IDE provides comprehensive development environment for code intellisense and track down bugs using a full power of modern debugger while running Strategy under market simulation. Set breakpoints, step through strategy code and watch values change during execution.

Strategy Instance

Strategies is a programmable component that is plugged and configured within BlitzTrader platform. It is usable when system administrator assigns the permissions and roles of it to trading user. It is then trading user responsibility to create the usable portfolio of strategy by assigning a tradable instruments and state of the strategy parameter. The creation of portfolio and assigning a state is termed as Strategy Instance creation process. Strategy Instance is analogous to a object of a class created at run-time.

Administrator

Administrator can create a trading user, assign strategies, exchange segment and define a risk constraint.

Trading User

Trading user logged to a BlitzTrader trading dashboard to manage and control automated trading strategies. Every running strategies Instance is owned by some trading user.

Exchange/Broker Adapter

BlitzTrader provides comprehensive Framework and Integration interface to develop your own connectivity adapter to use a particular exchange or broker system in process of achieving a Direct Market Access (DMA) and facilitates the connectivity to Exchanges, Broker, ECN, Banks etc.
It enables trading firm to build out fully transparent cross-region trading infrastructure, so they can connect to any market around the globe.
The adapter role is intermediary to establish a connection oriented session with exchange and translate Blitz OMS messages to counterpart system defined messages and vice-versa. The BlitzTrader API provides a well define interface of communication between BlitzTrader OMS and Exchange adapter component. In basic Exchange Adapter is the gateway to the liquidity provider for market data, order routing and execution. It can optionally also hold an implementation of a market data feeder.
The BlitzTrader FIX component greatly simplifies the development of FIX based counterparty adapter plugin. FIX component offer comprehensive, high performance support for FIX standard and routing via FIX stream.

Exchange Segment

A liquidity venues in BlitzTrader is identified as an Exchange Segment. BlitzTrader supports connectivity to the multiple markets to use either as a source of market data information or for the order routing or both. Each connectivity to the Exchange/Broker gateway system is managed by a programmable component called Adapter. BlitzTrader provides a comprehensive API and framework to develop and integrate the exchange adapter as a plugin component. Each adapter is identified by unique name identifier called Exchange Segment. Every tradable instrument also linked to specific exchange segment which helps, BlitzTrader framework to easily identify the Adapters to route the order for an Instrument.

Instrument

Instrument is basic component of any trading system and holds an information about tradable securities for a given exchange segment. It holds some financial value and can be of type Equities, Futures, Options, Currency, etc.
BlitzTrader platform support multiple exchange connectivity and each connectivity is managed through an adapter component represented as an exchange segment.
Following is some of the instrument properties:
Name Security Type Exchange Segment TickSize LotSize Expiry StrikePrice OptionType
ESM15 FUTURES CME 0.25 1 June 2015 - -
GOOG EQUITY NASDAQ 0.01 1 - - -
NIFTY FUTURES NSEFO 0.05 50 26Feb2015 - -
SBIN OPTIONS NSEFO 0.05 500 26Feb2015 295.00 CE
RELIANCE EQUITY NSECM 0.05 300 - - -
USD/INR FUTURES NSECD 0.0025 1000 26Feb2015 - -
EUR/USD FOREX FXCM 0.0001 1000 - - -

BlitzTrader API provides an abstract Instrument class that represents exchange traded contracts i.e. Equity, Futures, Options, Spread and Spot(Forex)
The instrument class contains all the common properties that define the contract such as name, exchange id, exchange segment, tick size, lot size etc.
The others properties of Instrument are more embedded into a concrete instrument type class, such as derivative contracts (Futures, Options) contain expiration date. Options contract contains strike price, options type (CE, PE, CA, PA) etc.
Any custom properties of an Instrument can be added through an Extended Market Properties mechanism of inserting key-value pair. BlitzTrader Framework laid down a process to import tradable instrument definitions and persist it internally.
BlitzTrader Adapter is a programmable component representing the exchange segment and provides the access of the market for both trading and market data interface. It is Adapter responsibility to provide the list of tradable Instrument to the BlitzTrader framework.
For more details, please refer to Adapter section on How to import the Instrument definition into BlitzTrader? BlitzTrader maintains the unique name of instrument per exchange segment based on following nomenclature.
Instrument Types Symbology Example
Equity [Symbol Name] GOOG
Spot [Symbol Name] EUR/USD
Futures [Symbol Name] [Expiration Month] [Expiration Year] NIFTY FEB 2015
Options Symbol Name] [Expiration Month] [Expiration Year] [Option Type] [Strike Price] NIFTY FEB 2015 CE 8800

To access the Market Data Container interface of an Instrument from your strategy other than your Instrument Variable can be done as:


 IMarketDataContainerInfo marketDataContainerInfo = base.GetMarketDataContainer(ExchangeSegment.NSEFO, "NIFTY FEB 2015 CE 8800");
if (marketDataContainerInfo != null)
{
    ITouchLineInfo touchlineInfo = marketDataContainerInfo.TouchLineInfo;
    double bestBidPrice = touchlineInfo.BestBidPrice;
    int bestBidSize = touchlineInfo.BestBidSize;
    double bestAskPrice = touchlineInfo.BestAskPrice;
    int bestAskSize = touchlineInfo.BestAskSize;
    double lastPrice = touchlineInfo.LastPrice;
    int lastSize = touchlineInfo.LastSize;
    long lastTradedTime = touchlineInfo.LastTradedTime;
}

Instrument Variable (IV)

BlitzTrader provides a high level of abstraction of tradable instrument with a very powerful concept called Instrument variable (IV). Strategy developer needs to define a required number of instances of IV based on the strategy requirement. You can assume this is something you can buy or sell and have access of real-time price information.
For example, a pair trading statistical arbitrage strategy works on two historically correlated instruments has to define two IVs say PairLeg1 and PairLeg2.
When a well established price correlation between PairLeg1 and PairLeg2 broke down, i.e. stock PairLeg1 traded up while PairLeg2 traded down, they would sell PairLeg1 and buy PairLeg2, betting that the spread would eventually converge.
 private IVObject _ivObjectPairLeg1 = new IVObject("PairLeg1",
                                                "Pair First Leg",
                                                true,
                                                InstrumentType.Equity | InstrumentType.Futures | InstrumentType.Options,
                                                MarketDataType.All,
                                                OrderEventType.All);

private IVObject _ivObjectPairLeg2 = new IVObject("PairLeg2",
                                                "Pair Second Leg",
                                                true,
                                                InstrumentType.Equity | InstrumentType.Futures | InstrumentType.Options,
                                                MarketDataType.All,
                                                OrderEventType.All);

IVObject constructor summary

Creates a IVObject

 
public IVObject(string name,
                string description,
                bool isTradable,
                InstrumentType instrumentType,
                MarketDataType requiredMarketDataType,
                OrderEventType requiredOrderEventType)

name: Name of the instrument variable. This should be unique name across different instrument variable within the same strategy implementation class.
description: The multiple words description about instrument variable
isTradable: A boolean flag indicating whether order can be placed for attached instrument or not. In some cases instrument variable is defined to extract only a market data as a reference to trade on other instrument variables. In this case we can define instrument variable as non tradable. Any order sending attempt to non-tradable instrument variable will be failed.
instrumentType: Represent asset class type of instrument variable.
Member name Value Description
Futures 1 Represent Futures contract
Options 2 Represent Options contract
Spread 4 Represent 2-Leg Spread contract
Equity 8 Represent Equity contract
Spot 16 Represent Spot contract (Forex)

requiredMarketDataType: IV declare itself for the kind of market event it is interested to listen.
Primary market events are:
Touchline – Delivers the best price change event, including last traded price change.
MarketDepth – Deliver the 5 best buy and sell prices change event. The market data information is delivered to your strategy implementation class through an overridden callback method:
 override void OnMarketDataEvent(StrategyMarketDataEventArgs strategyMarketDataEventArgs)

Member name Value Description
None 1 Represent no market data event delivered as a callback event
Touchline 2 Represent level-I market data event delivered as a callback event
MarketDepth 4 Represent level-II market data event delivered as a callback.event
All 8 Represent all type of market data event delivered as a callback event

requiredOrderEventType: This attribute is valid for a tradable IV and allow programmer to register for different order events that triggers during the order state changes during the order lifecycle. This allows programmers to receive the order events as a callback function for a respective order state change.
Member name Value Description
None 1 Represent no order event delivered as a callback
OrderAccepted 2 Represent a order accepted event by exchange is delivered as a callback method: protected override void OnOrderAccepted(IVObject ivObject, OrderAcceptedEventArgs orderAcceptedEventArgs)
OrderRejected 4 Represent a order rejected event by exchange is delivered as a callback method: protected override void OnOrderRejected(IVObject ivObject, OrderRejectedEventArgs orderRejectedEventArgs)
OrderModificationAccepted 8 Represent a order modification request accepted by exchange is delivered as a callback method: protected override void OnOrderModified(IVObject ivObject, OrderModificationAcceptedEventArgs orderModificationAcceptedEventArgs)
OrderModificationRejected 16 Represent a order modification request rejected event by exchange is delivered as a callback method: protected override void OnOrderModificationRejected(IVObject ivObject, OrderModificationRejectEventArgs orderModificationRejectEventArgs)
OrderCancellationAccepted 32 Represent a order cancellation request accepted event by exchange is delivered as a callback method: protected override void OnOrderCancelled(IVObject ivObject, OrderCancellationAcceptedEventArgs orderCancellationAcceptedEventArgs)
OrderCancellationRejected 64 Represent a order cancel request rejected event by exchange is delivered as a callback method: protected override void OnOrderCancellationRejected(IVObject ivObject, OrderCancellationRejectEventArgs orderCancellationRejectEventArgs)
OrderTraded 128 Represent a order traded event by exchange is delivered as a callback method: protected override void OnTrade(IVObject ivObject, TradeDataEventArgs tradeDataEventArgs)
OrderTriggered 256 Represent a stop order triggered event by exchange is delivered as a callback method: protected override void OnOrderTriggered(IVObject ivObject, OrderTriggeredEventArgs eventArgs)
All 510 Represent all above event by exchange is delivered on their respective callback method

The strategy implementation class must override following property to return to framework the list of Instrument Variables used in the Strategy.
 public override IVObject[] IVObjects

The framework manages to assign a concrete Instrument based on Traders request for portfolio creation. The mapped Instrument to IV is subscribed for market and order events delivered through an event callback mechanism to the Strategy.
 public override IVObject[] IVObjects
{
    get
    {
        List _ivObjectArray = new List();

        _ivObjectArray.Add(_ivOptionObject);
        _ivObjectArray.Add(_ivUnderlyingObject);

        return _ivObjectArray.ToArray();
     }
}

AppOrderID

The trading order generated from strategy instance is uniquely assigned and identified by BlitzTrader as AppOrderID. This is internal ID assigned to the order and can also be referred as Client Order ID.