From Backtesting to Live Trading by Vesna Straser at QuantCon 2016Quantopian
Dr. Vesna Straser will discuss the differences in expected slippage between live trading, simulation trading and backtesting. Typically in backtesting signal generation and order fill assumptions are simplified to obtain strategy performance data faster. For example, many commercial back testing software providers will work with sampled data such as minute open or close price points and assume that the signal is triggered at the close of one bar and filled at the close price of the next bar, per the assumed slippage model. Simulation trading, however, will typically run on tick trading data (live or replayed) potentially resulting in quite different dynamics versus back testing. Orders are filled per fill assumptions that may vary significantly between different providers. In live trading, orders are triggered and executed immediately under real market conditions and order type. Depending on the trading strategy, live trading results can differ dramatically from back-testing and/or simulation trading. Vesna will outline the issues, analytics to track, factors to consider and how to account for them to achieve “realistic” back-testing results.
From Backtesting to Live Trading by Vesna Straser at QuantCon 2016Quantopian
Dr. Vesna Straser will discuss the differences in expected slippage between live trading, simulation trading and backtesting. Typically in backtesting signal generation and order fill assumptions are simplified to obtain strategy performance data faster. For example, many commercial back testing software providers will work with sampled data such as minute open or close price points and assume that the signal is triggered at the close of one bar and filled at the close price of the next bar, per the assumed slippage model. Simulation trading, however, will typically run on tick trading data (live or replayed) potentially resulting in quite different dynamics versus back testing. Orders are filled per fill assumptions that may vary significantly between different providers. In live trading, orders are triggered and executed immediately under real market conditions and order type. Depending on the trading strategy, live trading results can differ dramatically from back-testing and/or simulation trading. Vesna will outline the issues, analytics to track, factors to consider and how to account for them to achieve “realistic” back-testing results.
by
Mark Goetsch
*
The Pieces
Arbitrage
Quotes
Order Matching
STP
*
*
*
*
“I enter orders[1] in an order book[2] for a specific market[3]. The orders are matched at discrete time time intervals that are controlled by a heartbeat[4]. The orders can be either buy[5] or sell[6] orders[1]. The order matcher will will check whenever a new order[1] is entered into the market. The time will be marked by the heartbeat[4]. If there is a match[7] then the order matcher will either fully match the order[8] or partially match the order[9].”
Patterns Used
Orders
Orderbook
Market
Heartbeat
Buy Order
Sell Order
Match
Full Match
Partial Match
*
*
*
Time Beat
Invalid Order
Match
Match Rules
Sell Orders
Buy Orders
Full Match
Partial Match
Orders
*
*
*
A customer authenticates[1] to a particular contract[2] which belongs to a market[3]. An order[5] is then presented to the orderbook[4] but not before checking the order[5] against the customers margin[6] which is different for every contract[2].
Gateway Analysis Pattern
Patterns Used
Authenticate
Contract
Market
Orderbook
Order
Margin
*
*
*
Authentication
Margin
Contract
Order
Market
Order Book
*
*
*
Rules that are used for every matching possibility.
*
*
*
*
*
Opening Rules =>
How are orders entered before the opening
Closing Rules =>
How are orders handled at the end
Trading Rules =>
How are orders matched
*
*
*
Limit Order
Against
Limit Order
Buy Limit in book >= incoming sell Limit
Sell Limit in book <= incoming buy Limit
Match buy quantity
Best Buy Limit
Match sell quantity
Best Sell Limit
“The incoming order is a limit order. It matches against the best limit in the book (bid price >= ask price) for the incoming limit order. The best limit in the book determines the price”
Remaining buy quantity
Remaining sell quantity
*
*
*
Three Stages to Opening the Market
Staging Period – Orders are entered and a countdown begins which calculates the Indicative Opening Price (IOP) is possible (see table below).
Non-Cancel Period – Can enter new orders but not cancel orders. The final IOP is calculated.
Opening – Orders that can be matched are matched. Pre-Opening State of BookConditionsSettle ExistsNo Settle ExistsNo Entries--nothing--Settle--nothing--Bids OnlyBid > Settle
Bid = Settle
Bid < SettleBid
Bid
SettleBid
Bid
BidOffers OnlyOffer > Settle
Offer = Settle
Offer < SettleSettle
Offer
OfferOffer
Offer
OfferBids and Offers
No Trades PossibleSettle = Offer
Settle = Offer
Bid < Settle < Offer
Bid = Settle
Bid > SettleOffer
Offer
Settle
Bid
BidBid
Bid
Bid
Bid
BidBids and Offers
Trades PossibleBid > OfferIOP
(Indicative Opening Price)IOP
(Indicative Opening Price)
*
*
*
*
Order Matcher
Front End Connectivity
CME GLOBEX API
CBOEdirect API
CBOE Trade Match
CME GLOBEX
Trade Match
Trade Processing and Clearing
*
*
CMI
FIX 4.2
Ilink FIX 4.2
FIX 4.2
FIX 2.3 Express
Confirm Record
CMTA/
Allocation
Trade Correction
Confir ...
The degree at which consumers change their purchasing behaviour is known as Elasticity. Homework Guru provides Elasticity and forecasting homework help to students across the world. For more visit www.homeworkguru.com or send us an email at support@homeworkguru.com
Forex Trading Program Concepts by Todd Hanson PhDTodd Hanson PhD
According to Todd hanson PhD, on Livetradesignals trading platform, you can establish ongoing relationships with other traders that want to share ideas and experiences.
Advance Option Trading Strategy Mentorship Program - For More Details Visit - https://www.ptaindia.com/advance-option-trading-strategies-mentorship-program/
Or Call +91 9261211003
Advance Option Trading Strategy Mentorship Program - For More Details Visit - https://www.ptaindia.com/advance-option-trading-strategies-mentorship-program/
Or Call +91 9261211003
by
Mark Goetsch
*
The Pieces
Arbitrage
Quotes
Order Matching
STP
*
*
*
*
“I enter orders[1] in an order book[2] for a specific market[3]. The orders are matched at discrete time time intervals that are controlled by a heartbeat[4]. The orders can be either buy[5] or sell[6] orders[1]. The order matcher will will check whenever a new order[1] is entered into the market. The time will be marked by the heartbeat[4]. If there is a match[7] then the order matcher will either fully match the order[8] or partially match the order[9].”
Patterns Used
Orders
Orderbook
Market
Heartbeat
Buy Order
Sell Order
Match
Full Match
Partial Match
*
*
*
Time Beat
Invalid Order
Match
Match Rules
Sell Orders
Buy Orders
Full Match
Partial Match
Orders
*
*
*
A customer authenticates[1] to a particular contract[2] which belongs to a market[3]. An order[5] is then presented to the orderbook[4] but not before checking the order[5] against the customers margin[6] which is different for every contract[2].
Gateway Analysis Pattern
Patterns Used
Authenticate
Contract
Market
Orderbook
Order
Margin
*
*
*
Authentication
Margin
Contract
Order
Market
Order Book
*
*
*
Rules that are used for every matching possibility.
*
*
*
*
*
Opening Rules =>
How are orders entered before the opening
Closing Rules =>
How are orders handled at the end
Trading Rules =>
How are orders matched
*
*
*
Limit Order
Against
Limit Order
Buy Limit in book >= incoming sell Limit
Sell Limit in book <= incoming buy Limit
Match buy quantity
Best Buy Limit
Match sell quantity
Best Sell Limit
“The incoming order is a limit order. It matches against the best limit in the book (bid price >= ask price) for the incoming limit order. The best limit in the book determines the price”
Remaining buy quantity
Remaining sell quantity
*
*
*
Three Stages to Opening the Market
Staging Period – Orders are entered and a countdown begins which calculates the Indicative Opening Price (IOP) is possible (see table below).
Non-Cancel Period – Can enter new orders but not cancel orders. The final IOP is calculated.
Opening – Orders that can be matched are matched. Pre-Opening State of BookConditionsSettle ExistsNo Settle ExistsNo Entries--nothing--Settle--nothing--Bids OnlyBid > Settle
Bid = Settle
Bid < SettleBid
Bid
SettleBid
Bid
BidOffers OnlyOffer > Settle
Offer = Settle
Offer < SettleSettle
Offer
OfferOffer
Offer
OfferBids and Offers
No Trades PossibleSettle = Offer
Settle = Offer
Bid < Settle < Offer
Bid = Settle
Bid > SettleOffer
Offer
Settle
Bid
BidBid
Bid
Bid
Bid
BidBids and Offers
Trades PossibleBid > OfferIOP
(Indicative Opening Price)IOP
(Indicative Opening Price)
*
*
*
*
Order Matcher
Front End Connectivity
CME GLOBEX API
CBOEdirect API
CBOE Trade Match
CME GLOBEX
Trade Match
Trade Processing and Clearing
*
*
CMI
FIX 4.2
Ilink FIX 4.2
FIX 4.2
FIX 2.3 Express
Confirm Record
CMTA/
Allocation
Trade Correction
Confir ...
The degree at which consumers change their purchasing behaviour is known as Elasticity. Homework Guru provides Elasticity and forecasting homework help to students across the world. For more visit www.homeworkguru.com or send us an email at support@homeworkguru.com
Forex Trading Program Concepts by Todd Hanson PhDTodd Hanson PhD
According to Todd hanson PhD, on Livetradesignals trading platform, you can establish ongoing relationships with other traders that want to share ideas and experiences.
Advance Option Trading Strategy Mentorship Program - For More Details Visit - https://www.ptaindia.com/advance-option-trading-strategies-mentorship-program/
Or Call +91 9261211003
Advance Option Trading Strategy Mentorship Program - For More Details Visit - https://www.ptaindia.com/advance-option-trading-strategies-mentorship-program/
Or Call +91 9261211003
2. AGENDA
Overview of Trade Flow
Exchange/Trading House Operations
Member Registration
Market Place
Deal/Trade Capture
Information/Market Dissemination
Market Control/Regulation & Supervision
Exchange Trading Terminal
Other Functions of Exchange
4. 1 - Client request TM to place
TRADE FLOW
order
2 – TM places order at
Exchange
1’ – Client can directly place
order using DMA
3 – (a) TM can modify existing
order (b) Exchange provides
Order status/Executions/Market
Data
4 – TM updates client on order
rejection/executions
3’ – TM updates CM about
Executions
4 – Exchange sends deal/trades
info to Clearing House
4’ – Client informs CM about
trades
5 – CM sends clearing
instructions to CH
6 – CM-CH interaction for risk
management/position
management/settlement
instruction
7 – CM updates Client about
positions/settlement
status/margins
8,8’ – Settlement Instructions
sent to & tracked from
Bank/Settlement House
9 – CM sends SI to SP
10 – SP sends SI to SH
11 – Physical settlement
updates to SP
12 – Settlement Status updated
back to CM
7. EXCHANGE FUNCTIONS
Member Registration
Market Place
Deal/Trade Capture
Information/Market Dissemination
Market Control/Regulation & Supervision
Exchange Trading Terminal
8. MEMBER REGISTRATION - FUNCTIONS
Deals with Registration of Member
Membership Capacity/Role Set up
Member Suspension/Revocation
Market in which Member will act
TM-CM relationship set up
9. MARKET PLACE - FUNCTIONS
Order/Quote Handling
• Orders & Quotes are received &
• Validated based on Exchange rules & regulations
• Processing of orders and quotes
• Storable orders are placed in order books
Order Matching
• Ranking of orders in the order book
• Matching of orders
Order/Trade Information
• Real Time order/trade information dissemination
• Trade info provided to other departments of Exchange
10. EXECUTION MODELS/TRADING MECHANISM
Automatic Order Book [Both order-driven/quote-driven]
Continuous Execution
Auction Execution
Odd Lot Execution
Standard Strategy (Exchange Defined Basket)
Execution
Non – Standard Strategy (TM Defined Basket)
Execution
Trade Reports Execution
Bulletin Board (Pink Boards) Execution
Quote Requests & their Execution
Non- Tradable Instrument Execution
11. CONTINUOUS EXECUTION
Orders successfully received are immediately eligible for matching
Fill & Store orders with remaining quantity left after earlier
matching attempt, are stored in order book
Order Ranking used for matching is mostly price-time
Execution price recognition logic
if incoming order price matches with the highest rank counter order then
the order price is the Execution Price
if the incoming order price is better than the existing counter order in the
order book then Execution Price can be determined as:
Alternative 1: use the price of the existing order in the order book as the deal price
Alternative 2: use the average price of the existing order in the order book and the
incoming order as a deal price
Execution price dissemination logic
if the incoming order results in single trade then the price disseminated
will be the trade/deal price
If the incoming order results in multiple trade then the price dissemination
will happens as:
If incoming order is a buy order, the deal prices are sent out in increasing order
If incoming order is a sell order, the deal prices are sent out in decreasing order
13. CONTINUOUS EXECUTION - EXAMPLE
Bids Asks
Price Quantity Time Price Quantity Time
101 6 10:04 100 5 10:02
99 15 10:01 100.50 7 10.03
101 10 10:01
The result is two trades – one of order quantity 5 (Trade 1)
and another 1 (Trade 2)
Alternative 1:
Execution Price of Trade 1 – 100 & Trade 2 – 100.50.
Disseminated in the same order
Alternative 2:
Execution Price of Trade 1 – 100.50 ( Avg of 101 and 100) &
Trade 2 – 100.75 (Avg of 101 & 100.50). Disseminated in the
same order
14. AUCTION EXECUTION
Auction Execution consists of two phase
Order Entry Phase
In this the orders are placed and the same are stored in the
order book after validation & processing
No matching is performed during this phase
Indicative Equilibrium/Auction price is calculated during
this phase
Auction Phase
This is the phase in which actual auction happens
The Equilibrium price becomes the auction price
When disseminating price information in the order entry
phase, orders that have a better price than the EP are
masked with price equal to Equilibrium/Auction Price
15. EQUILIBRIUM/AUCTION PRICE (EP) LOGIC
EP is the price at which the highest volume gets traded
All orders considered in identification of EP
If multiple EPs with same traded volume, then the one with
lowest Normal Order Imbalance is selected
If multiple EPS with same order imbalances, then the price
closest to Instrument Reference Price is selected
In case none of the above price exists, theoretical price is
calculated and EP is compared with that
Note:
Normal Order Imbalance – this is the volume/quantity of the orders
which didn’t get traded due to missing volume on the opposite side of
the EP, even though their prices are better than EP
Instrument Reference Price – It is first of these values - last traded
price, last settlement price, closing price. If none exist then it is the
theoretical price calculated by Exchange
16. AUCTION EXECUTION EXAMPLE
Bids Asks
Price Quantity Price Quantity
51 45 50 75
50 45
The EP in this scenario is 50 (match quantity is max = 75)
Bid Ask
Price Quantity Price Quantity
50 90 50 75
17. AUCTION EXECUTION EXAMPLE
Bids Asks
Price Quantity Price Quantity
52 45 49 75
51 45
50 25
If EP is 49, matched quantity is 75 & order imbalance is 40
If EP is 50 matched quantity is 75 & order imbalance is 0
Thus EP is 50
Bid Ask
Price Quantity Price Quantity
50 115 50 75
18. STANDARD STRATEGY EXECUTION
Standard Strategy (SS) is
Compound instrument, defined by Exchange for trading strategy
Also have their own order book
Generally have two to four legs
All legs traded to same decimal places and same currency
SS Execution
SS are executed only if all the legs are matched
SS matching can happen either in the SS order book or leg books
In order to perform SS matching at legs book, most exchange use Bait
order
SS Execution – Price dissemination
If matched in leg books, then price disseminated is same as matched
If SS matches with SS, then the leg price disseminated is generally as
below:
Bid Price – ‘Current Bid Price + 1 tick’ or closing price or settlement price
Sell Price – ‘Current Ask Price + 1 tick’ or closing price or settlement price
19. STANDARD STRATEGY – BAIT ORDER EXAMPLE
Series:
GFARMNTH – Google Far Month Series
GNERMNTH – Google Near Month Series
GFRNRSPRD – Google Near Month (S) – Far Month (B) series
Series Bids Asks
Price Quantity Price Quantity
GFARMNTH 5.00 7 Bait Order
GNERMNTH 7.00 20
GFRNRSPRD 2.00 7
20. NON-STANDARD STRATEGY EXECUTION
Non-Standard Strategy is
Defined by trading members
No order book exists for the same
The matching happens only at leg books
Partial execution can happen
Execution happens as for each leg as normal
instrument order
21. TRADE REPORTS
Trade Reports is for Deals closed outside the Exchange
Each trading participant reports the Trade independently
Exchange validates each leg individually based on rules
and regulations
Exchange performs matching of these reported trade legs
Dissemination happens in a independent and transparent
method
22. BULLETIN BOARD
Bulletin Board is used by TMs for announcing the interest
to buy or sell an instrument
The execution model of bulletin board orders doesn’t follow
price-time ranking
Amendment/Deletion is allowed on Bulletin orders
It allows to trade on single instrument and strategy
Instrument may or may not be traded on Automatic
Market
23. QUOTE REQUESTS
Generally used when markets are illiquid
TM can request quote for an instrument
Quote request received by Exchange is forwarded to
Market Makers and other Trading Members (depends on
rules & regulation)
Actual quote comes in the generic Automatic Continuous
Market
Quote requests are not related to actual order matching
24. NOTES: ORDER ATTRIBUTES
Instrument
Order Type
Limit Order (Order validity – F&S, F&K, FoK)
Market Order (Order validity – F&S, F&K, FoK)
Market to Limit Order
Best Limit Order
Iceberg
Order Validity
Rest of Day
Good till Date (Number of Days)
Good till Cancelled (Unlimited)
Side – Bid/Ask
Price
Quantity
Trade Quantity
Hidden Quantity
Lot Size/Block Size
Open/Close Indicator
Client Information
Give Up Information
25. NOTES: SESSIONS
Generally there are two main sessions :
Trading Session – defined for each Market
Instrument Session – defines activation/suspension of
instruments/series
Every session is defined by its state:
Pre-Open
Open
Closed
26. DEAL/TRADE CAPTURE
After the orders are matched trade is formed
The trade information needs to be stored for following
purpose:
To disseminate the information to the trading members
To disseminate the information to the clearing &
settlement houses
For regulatory purpose
Cancel/Amendment of trades
27. INFORMATION/MARKET DISSEMINATION
Exchange Disseminates Market, Trade & Order Information
to the Trading Participants
The Information is provided at two levels:
Market Level – Price Statistics, Market Depth
Market per Order Level
The other information which are disseminated are:
Product Information
Historical Trade Information
Corporate Actions
Session Information
28. MARKET CONTROL/REGULATION & SUPERVISION
Trading Surveillance
Checks
Price Limits/Circuit Filters
Best Price Movements
Trade Quantity Limit etc.
Alarms are set for these checks
Market Making Surveillance
Checks
Market Maker performance metrics
MM Performance reports
Alarms are set for these checks
29. EXCHANGE TRADING TERMINAL
Acts as the direct interface for Trading Members to access
Exchange.
Main Functions supported on the Terminal:
Market Match (use default & create own Market watches)
Place Orders
Market Making – placing quotes
View/Modify orders
View Historical Data
View of news and alerts published by exchange
View own Trades
Rectify own Trades
View Intra-day Open trade positions at account level
View Market Watch/Depth and Symbol details
Define/View Trading Limits
Download Reports
30. OTHER IMPORTANT FUNCTIONS OF EXCHANGE
Defining Market Structure
Instrument Set up
Series Generation
Providing API interface for Members to connect using own
Application
Fees & Billing
Regulatory Reporting