SlideShare uma empresa Scribd logo
1 de 30
Comparison of Behaviors of
Actual and Simulated HFT Traders
for Agent Design
Masanori HIRANO, Kiyoshi IZUMI,
Hiroyasu MATSUSHIMA, Hiroki SAKAJI
Izumi Lab.
School of Engineering, The University of Tokyo
hirano@g.ecc.u-tokyo.ac.jp
https://mhirano.jp/
Increasing Uncertainty in Financial Market
• The 2007-2008 financial crisis
• Flash crashes
• happened in stock market, currency, etc.…
• The causes: Auto trading, Auto news analysis…
• DJIA on May 6, 2010 <-- One big sell order
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
2
Artificial Financial Market
• Simulations on computer using virtual markets
• We can test hypothetical situations!
• Promising approach for financial market analysis
• But…
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
3
Artificial Financial Market
• Simulations on computer using virtual markets
• We can test hypothetical situations!
• Promising approach for financial market analysis
• But…
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
4
Are the simulations trustable?
Our work
• Comparing
Real data  Outcomes from simulations
• Only focus on HFT-MM  Specific trader & strategy
• Target: Tokyo Stock Exchange
• Collaborative Research w/
Japan Exchange Group (JPX)
• We analyzed a special data
provided by JPX
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
5
Tokyo Stock Exchange
What’s the HFT-MM?
• High-Frequency-Trader Market-Making strategy
• Market-making strategy:
• (Basically) order near the best price
• Get profit by the spread (1001-999=2)
• Do repeatedly
• Risk-hedge by high-frequency-trade:
• Always have price move risk (Price move >> spread)
• Do action faster & hedge risk by setting off their inventory
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
6
Sell
Buy
Study Outline
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
7
Data Simulation
HFT-MM
Order Data
HFT-MM
Order Data
in Simulation
Comparison
Processing, VS merging,
Clustering
Study Outline
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
8
Data Simulation
HFT-MM
Order Data
HFT-MM
Order Data
in Simulation
Comparison
Processing, VS merging,
Clustering
Simulation outline
• We used “PlhamJ” as a simulation platform.
PlhamJ: Platform for Large-scale and High-frequency Artificial Market (Java version)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
9
Market (Only one)
Continuous Double Auction
HFT-MM Traders
・・・
Stylized Traders
・・・
Order
Information
Order
Information
100 Stpes Delay
Only Every 100 Steps
Stylized Trader Agents [Chiarella et al. 02]
• Logarithmic return prediction for bid/ask price
𝑟 =
1
𝑤 𝐹+𝑤 𝐶+𝑤 𝑁
𝑤 𝐹 ⋅ 𝐹 + 𝑤 𝐶 ⋅ 𝐶 + 𝑤 𝑁 ⋅ 𝑁
• Fundamentals
𝐹 =
1
mean reversion time
ln
current market price
current fundamental price
• Chartist (trend)
𝐶 = logarithm averaged return in the past
• Noise 𝑁 ~ 𝑁 0, 𝜎 𝑁
• + margin => decide price
• Every 100 step they make a buy or sell order
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
10
HFT-MM Trader Agents [Avellaneda et al. 02]
• Trader’s price interval:
𝛾 𝑖
𝜎 𝑖
2
+
2
𝛾 𝑖
ln 1 +
𝛾 𝑖
𝑘
• Trader’s mid-price
𝑝𝑡
∗
− 𝛾 𝑖
𝜎 𝑖
2
𝑞𝑡
𝑖
• Note:
𝛾 𝑖: risk-hedge level
𝜎 𝑖: SD in price
𝑘: a parameter for order arrival
𝑝𝑡
∗
: fundamental price
𝑞𝑡
𝑖
:inventory
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
11
Price
Sell
Buy
Fundamental Price
Trader’s mid-price
Trader’s price interval
Simulation settings
• 1,000 stylized agents vs. 10 HFT-MM trader agents
• 100 steps before market opening
+ 500 dummy steps for stabilization
+ 10,000 steps for test
• Fundamental price:
• Start at 400
• Geometric Brownian motion with SD of 0.0001
• Run 21 times
(The same as the business day in real data in Aug. 2015)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
12
Ordering Price Distribution (Simulation)
• HFT-MM ordering price distribution
= How many ticks far from the best price
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
13
− 5 0 5 10 15
0.0e+0
5.0e+3
1.0e+4
1.5e+4
2.0e+4
Order
Executed Order
Ticks
Freq.
Study Outline
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
15
Data Simulation
HFT-MM
Order Data
HFT-MM
Order Data
in Simulation
Comparison
Processing, VS merging,
Clustering
Data
• “Order-book reproduction data”
provided by Japan Exchange Group (JPX)
• Containing masked trader information
<- Called “Virtual Server (VS)”
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
16
Time Ticker Kind Buy/sell VS Price
11:11:50.702813 A Limit Order sell VS1 2570
11:11:50.703600 B Executed buy VS4 Market Order
11:11:50.704001 A Cancel sell VS1 2570
Sample
Some columns are not shown such as volume
Data: VS merging
• Virtual Server: Gateway to the order system
for brokers
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
17
Limit: 60,20,10 orders/s
(depends on contract)
Data: VS merging
• Merging VS as many as possible
• Focus on each continuous actions
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
18
Order01 Limit Order
Data: VS merging
• Merging VS as many as possible
• Focus on each continuous actions
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
19
Order01 Cancel
Data: VS merging
• Merging VS as many as possible
• Focus on each continuous actions
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
20
Used by the
same trader!
Indices for clustering (extracting HFT-MM)
• The logarithm of action per ticker
ActionsPerTicker =
newOrders + changeOrders + (cancelOrders)
(numTicker)
ActionsPerTickerLOG = ln ActionsPerTicker
• Inventory Ratio
InventoryRatioABS
= 𝑀𝑒𝑑𝑖𝑎𝑛ticker
soldVolume ticker − boughtVolume ticker
soldVolume ticker + boughtVolume ticker
• Cancel ratio
CanceledVolumeRatio =
(cancelVolume)
(newVolume)
• The logarithm of ticker per VS
TickerPerVSLOG = ln
(numTicker)
(numVS)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
21
Many order
Low inventory
Many VS usage
High cancel ratio
Indices for clustering (extracting HFT-MM)
• The logarithm of action per ticker
ActionsPerTicker =
newOrders + changeOrders + (cancelOrders)
(numTicker)
ActionsPerTickerLOG = ln ActionsPerTicker
• Inventory Ratio
InventoryRatioABS
= 𝑀𝑒𝑑𝑖𝑎𝑛ticker
soldVolume ticker − boughtVolume ticker
soldVolume ticker + boughtVolume ticker
• Cancel ratio
CanceledVolumeRatio =
(cancelVolume)
(newVolume)
• The logarithm of ticker per VS
TickerPerVSLOG = ln
(numTicker)
(numVS)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
22
Data outline
• Aug. 2015: All 21 business days
• Before VS merging: 4616 VSs
• After VS merging: 2664 VSs
• Only HFT: 253 VSs <= based on ActionsPerTicker ≥ 100
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
23
2455 2455
2161
209
253
Hierarchical Clustering [Uno et al. 18]
• Normalizations for each indices & clustering
• Euclidean distance
• Ward’s method
• 10 clusters
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
24
HFT-MM cluster based on indices
Ordering Price Distribution
• HFT-MM ordering price distribution
= How many ticks far from the last transaction price
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
25
− 5 0 5 10 15
0.0e+0
5.0e+8
1.0e+9
1.5e+9
2.0e+9
2.5e+9
Order
Executed Order
Ticks
Freq.
Study Outline
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
26
Data Simulation
HFT-MM
Order Data
HFT-MM
Order Data
in Simulation
Comparison
Processing, VS merging,
Clustering
Ordering Price Distribution
− 5 0 5 10 15
0.00
0.20
0.40
0.60
0.80
1.00 Order (Actual)
Order (Simulation)
Ticks
Relative Freq. (vs tick 0)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
27
Statistical test: Entropy
• T-test for
• Entropy for −5~15 tick
• Entropy for −2~5 tick
• This suggests:
• −2~5 tick: simulation & real data has small difference
• −5~2, 5~15 tick: simulation & real data has significant diff.
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
28
𝐸 = −𝑝 𝑥 log2 𝑝 𝑥
Ordering Price Distribution
− 5 0 5 10 15
0.00
0.20
0.40
0.60
0.80
1.00 Order (Actual)
Order (Simulation)
Ticks
Relative Freq. (vs tick 0)
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
29
Long tail:
know as “layering”
Discussion & Conclusion
• Near the best price, simulation and data are similar
• => our clustering method work
• => our simulation also work
• But, our simulation lost some features in real data
• Ex. Long tail
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
30
Future work
• Build more realistic simulation
• Also use data-driven approach for simulation
• Build simulation (trader) model automatically
• There are limitation for human to build perfect model
• Human-made model can drop some features
Thank you for your attention!
• The paper for social track will be published JASSS.
• You can access our preprint on ResearchGate
https://s.mhirano.jp/prima2019-preprint
• Or contact me: hirano@g.ecc.u-tokyo.ac.jp
https://mhirano.jp/
10/31/19
PRIMA 2019
©︎M.HIRANO & Izumi Lab.
31

Mais conteúdo relacionado

Semelhante a 2019/10/31 PRIMA2019: Comparison of Behaviors of Actual and Simulated HFT Traders for Agent Design

A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
haji mizu
 
1b kno how on costs
1b kno how on costs1b kno how on costs
1b kno how on costs
pjvicary
 

Semelhante a 2019/10/31 PRIMA2019: Comparison of Behaviors of Actual and Simulated HFT Traders for Agent Design (20)

Toshiba laptop
Toshiba laptopToshiba laptop
Toshiba laptop
 
How Many Orders does a Spoofer Need? - Investigation by Agent-Based Model -
How Many Orders does a Spoofer Need?  - Investigation by Agent-Based Model -How Many Orders does a Spoofer Need?  - Investigation by Agent-Based Model -
How Many Orders does a Spoofer Need? - Investigation by Agent-Based Model -
 
Man Acc KNUST lecture 2 break even analysis.ppt
Man Acc KNUST lecture 2 break even analysis.pptMan Acc KNUST lecture 2 break even analysis.ppt
Man Acc KNUST lecture 2 break even analysis.ppt
 
Xiaomi Mi 8 Explorer Teardown and Identification of Key Components
Xiaomi Mi 8 Explorer Teardown and Identification of Key ComponentsXiaomi Mi 8 Explorer Teardown and Identification of Key Components
Xiaomi Mi 8 Explorer Teardown and Identification of Key Components
 
Applied Machine Learning in Finance: Estimating Missing Bid-Ask Spreads and D...
Applied Machine Learning in Finance: Estimating Missing Bid-Ask Spreads and D...Applied Machine Learning in Finance: Estimating Missing Bid-Ask Spreads and D...
Applied Machine Learning in Finance: Estimating Missing Bid-Ask Spreads and D...
 
Manufacturing agricultural machine bussiness idea Presentation.pptx
Manufacturing agricultural machine bussiness idea Presentation.pptxManufacturing agricultural machine bussiness idea Presentation.pptx
Manufacturing agricultural machine bussiness idea Presentation.pptx
 
Ad science bid simulator (public ver)
Ad science bid simulator (public ver)Ad science bid simulator (public ver)
Ad science bid simulator (public ver)
 
Revenue Relationship and Pricing Policies
Revenue Relationship and Pricing PoliciesRevenue Relationship and Pricing Policies
Revenue Relationship and Pricing Policies
 
Danshui
DanshuiDanshui
Danshui
 
Should I go to Brazil?
Should I go to Brazil? Should I go to Brazil?
Should I go to Brazil?
 
Theory of the Firm Lecture Notes (Economics)
Theory of the Firm Lecture Notes (Economics)Theory of the Firm Lecture Notes (Economics)
Theory of the Firm Lecture Notes (Economics)
 
A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
A Prototype Prediction Market Game for Enhancing Knowledge Sharing among Sale...
 
Use of Economic Evidence in Cartel Cases – ROBERTS – December 2023 OECD discu...
Use of Economic Evidence in Cartel Cases – ROBERTS – December 2023 OECD discu...Use of Economic Evidence in Cartel Cases – ROBERTS – December 2023 OECD discu...
Use of Economic Evidence in Cartel Cases – ROBERTS – December 2023 OECD discu...
 
1b kno how on costs
1b kno how on costs1b kno how on costs
1b kno how on costs
 
Global Sourcing and Domestic Production Networks
Global Sourcing and Domestic Production NetworksGlobal Sourcing and Domestic Production Networks
Global Sourcing and Domestic Production Networks
 
Hdfc amc shareholders presentation q4 fy20
Hdfc amc shareholders presentation q4 fy20Hdfc amc shareholders presentation q4 fy20
Hdfc amc shareholders presentation q4 fy20
 
Chap008 lecture
Chap008 lectureChap008 lecture
Chap008 lecture
 
Automated Trading
Automated TradingAutomated Trading
Automated Trading
 
Topic 7-Pure Competition in the Short-Run.pdf
Topic 7-Pure Competition in the Short-Run.pdfTopic 7-Pure Competition in the Short-Run.pdf
Topic 7-Pure Competition in the Short-Run.pdf
 
Why do Active Funds that Trade Infrequently Make a Market more Efficient? --...
Why do Active Funds that Trade Infrequently Make a Market more Efficient?  --...Why do Active Funds that Trade Infrequently Make a Market more Efficient?  --...
Why do Active Funds that Trade Infrequently Make a Market more Efficient? --...
 

Mais de Masanori HIRANO

Mais de Masanori HIRANO (9)

2023/03/04 sigfin30: 原資産価格過程不要な敵対的Deep Hedging
2023/03/04 sigfin30: 原資産価格過程不要な敵対的Deep Hedging2023/03/04 sigfin30: 原資産価格過程不要な敵対的Deep Hedging
2023/03/04 sigfin30: 原資産価格過程不要な敵対的Deep Hedging
 
2023/03/04 sigfin30 PR: Special Session on Applied Informatics in Finance and...
2023/03/04 sigfin30 PR: Special Session on Applied Informatics in Finance and...2023/03/04 sigfin30 PR: Special Session on Applied Informatics in Finance and...
2023/03/04 sigfin30 PR: Special Session on Applied Informatics in Finance and...
 
2022/11/17 PRIMA2022: Analysis of Carbon Neutrality Scenarios of Industrial C...
2022/11/17 PRIMA2022: Analysis of Carbon Neutrality Scenarios of Industrial C...2022/11/17 PRIMA2022: Analysis of Carbon Neutrality Scenarios of Industrial C...
2022/11/17 PRIMA2022: Analysis of Carbon Neutrality Scenarios of Industrial C...
 
2022/10/30 BESC2022: Parameter Tuning Method for Multi-agent Simulation using...
2022/10/30 BESC2022: Parameter Tuning Method for Multi-agent Simulation using...2022/10/30 BESC2022: Parameter Tuning Method for Multi-agent Simulation using...
2022/10/30 BESC2022: Parameter Tuning Method for Multi-agent Simulation using...
 
2022/03/12 sigfin28: オプションによるオプションのヘッジを可能にする二重 Deep Hedging 機構
2022/03/12 sigfin28: オプションによるオプションのヘッジを可能にする二重 Deep Hedging 機構2022/03/12 sigfin28: オプションによるオプションのヘッジを可能にする二重 Deep Hedging 機構
2022/03/12 sigfin28: オプションによるオプションのヘッジを可能にする二重 Deep Hedging 機構
 
2020/11/19 PRIMA2020: Simulation of Unintentional Collusion Caused by Auto Pr...
2020/11/19 PRIMA2020: Simulation of Unintentional Collusion Caused by Auto Pr...2020/11/19 PRIMA2020: Simulation of Unintentional Collusion Caused by Auto Pr...
2020/11/19 PRIMA2020: Simulation of Unintentional Collusion Caused by Auto Pr...
 
2020/03/18 NLP2020: 金融文書のための別タスク学習による教師なし重要文判定
2020/03/18 NLP2020: 金融文書のための別タスク学習による教師なし重要文判定2020/03/18 NLP2020: 金融文書のための別タスク学習による教師なし重要文判定
2020/03/18 NLP2020: 金融文書のための別タスク学習による教師なし重要文判定
 
2018/11/17 ICDMW 2018: Selection of Related Stocks using Financial Text Mining
2018/11/17 ICDMW 2018: Selection of Related Stocks using Financial Text Mining2018/11/17 ICDMW 2018: Selection of Related Stocks using Financial Text Mining
2018/11/17 ICDMW 2018: Selection of Related Stocks using Financial Text Mining
 
2018/06/06 JSAI2018 Effects Analysis of CAR Regulations on Financial Markets ...
2018/06/06 JSAI2018 Effects Analysis of CAR Regulations on Financial Markets ...2018/06/06 JSAI2018 Effects Analysis of CAR Regulations on Financial Markets ...
2018/06/06 JSAI2018 Effects Analysis of CAR Regulations on Financial Markets ...
 

Último

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Último (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

2019/10/31 PRIMA2019: Comparison of Behaviors of Actual and Simulated HFT Traders for Agent Design

  • 1. Comparison of Behaviors of Actual and Simulated HFT Traders for Agent Design Masanori HIRANO, Kiyoshi IZUMI, Hiroyasu MATSUSHIMA, Hiroki SAKAJI Izumi Lab. School of Engineering, The University of Tokyo hirano@g.ecc.u-tokyo.ac.jp https://mhirano.jp/
  • 2. Increasing Uncertainty in Financial Market • The 2007-2008 financial crisis • Flash crashes • happened in stock market, currency, etc.… • The causes: Auto trading, Auto news analysis… • DJIA on May 6, 2010 <-- One big sell order 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 2
  • 3. Artificial Financial Market • Simulations on computer using virtual markets • We can test hypothetical situations! • Promising approach for financial market analysis • But… 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 3
  • 4. Artificial Financial Market • Simulations on computer using virtual markets • We can test hypothetical situations! • Promising approach for financial market analysis • But… 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 4 Are the simulations trustable?
  • 5. Our work • Comparing Real data  Outcomes from simulations • Only focus on HFT-MM  Specific trader & strategy • Target: Tokyo Stock Exchange • Collaborative Research w/ Japan Exchange Group (JPX) • We analyzed a special data provided by JPX 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 5 Tokyo Stock Exchange
  • 6. What’s the HFT-MM? • High-Frequency-Trader Market-Making strategy • Market-making strategy: • (Basically) order near the best price • Get profit by the spread (1001-999=2) • Do repeatedly • Risk-hedge by high-frequency-trade: • Always have price move risk (Price move >> spread) • Do action faster & hedge risk by setting off their inventory 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 6 Sell Buy
  • 7. Study Outline 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 7 Data Simulation HFT-MM Order Data HFT-MM Order Data in Simulation Comparison Processing, VS merging, Clustering
  • 8. Study Outline 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 8 Data Simulation HFT-MM Order Data HFT-MM Order Data in Simulation Comparison Processing, VS merging, Clustering
  • 9. Simulation outline • We used “PlhamJ” as a simulation platform. PlhamJ: Platform for Large-scale and High-frequency Artificial Market (Java version) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 9 Market (Only one) Continuous Double Auction HFT-MM Traders ・・・ Stylized Traders ・・・ Order Information Order Information 100 Stpes Delay Only Every 100 Steps
  • 10. Stylized Trader Agents [Chiarella et al. 02] • Logarithmic return prediction for bid/ask price 𝑟 = 1 𝑤 𝐹+𝑤 𝐶+𝑤 𝑁 𝑤 𝐹 ⋅ 𝐹 + 𝑤 𝐶 ⋅ 𝐶 + 𝑤 𝑁 ⋅ 𝑁 • Fundamentals 𝐹 = 1 mean reversion time ln current market price current fundamental price • Chartist (trend) 𝐶 = logarithm averaged return in the past • Noise 𝑁 ~ 𝑁 0, 𝜎 𝑁 • + margin => decide price • Every 100 step they make a buy or sell order 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 10
  • 11. HFT-MM Trader Agents [Avellaneda et al. 02] • Trader’s price interval: 𝛾 𝑖 𝜎 𝑖 2 + 2 𝛾 𝑖 ln 1 + 𝛾 𝑖 𝑘 • Trader’s mid-price 𝑝𝑡 ∗ − 𝛾 𝑖 𝜎 𝑖 2 𝑞𝑡 𝑖 • Note: 𝛾 𝑖: risk-hedge level 𝜎 𝑖: SD in price 𝑘: a parameter for order arrival 𝑝𝑡 ∗ : fundamental price 𝑞𝑡 𝑖 :inventory 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 11 Price Sell Buy Fundamental Price Trader’s mid-price Trader’s price interval
  • 12. Simulation settings • 1,000 stylized agents vs. 10 HFT-MM trader agents • 100 steps before market opening + 500 dummy steps for stabilization + 10,000 steps for test • Fundamental price: • Start at 400 • Geometric Brownian motion with SD of 0.0001 • Run 21 times (The same as the business day in real data in Aug. 2015) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 12
  • 13. Ordering Price Distribution (Simulation) • HFT-MM ordering price distribution = How many ticks far from the best price 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 13 − 5 0 5 10 15 0.0e+0 5.0e+3 1.0e+4 1.5e+4 2.0e+4 Order Executed Order Ticks Freq.
  • 14. Study Outline 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 15 Data Simulation HFT-MM Order Data HFT-MM Order Data in Simulation Comparison Processing, VS merging, Clustering
  • 15. Data • “Order-book reproduction data” provided by Japan Exchange Group (JPX) • Containing masked trader information <- Called “Virtual Server (VS)” 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 16 Time Ticker Kind Buy/sell VS Price 11:11:50.702813 A Limit Order sell VS1 2570 11:11:50.703600 B Executed buy VS4 Market Order 11:11:50.704001 A Cancel sell VS1 2570 Sample Some columns are not shown such as volume
  • 16. Data: VS merging • Virtual Server: Gateway to the order system for brokers 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 17 Limit: 60,20,10 orders/s (depends on contract)
  • 17. Data: VS merging • Merging VS as many as possible • Focus on each continuous actions 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 18 Order01 Limit Order
  • 18. Data: VS merging • Merging VS as many as possible • Focus on each continuous actions 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 19 Order01 Cancel
  • 19. Data: VS merging • Merging VS as many as possible • Focus on each continuous actions 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 20 Used by the same trader!
  • 20. Indices for clustering (extracting HFT-MM) • The logarithm of action per ticker ActionsPerTicker = newOrders + changeOrders + (cancelOrders) (numTicker) ActionsPerTickerLOG = ln ActionsPerTicker • Inventory Ratio InventoryRatioABS = 𝑀𝑒𝑑𝑖𝑎𝑛ticker soldVolume ticker − boughtVolume ticker soldVolume ticker + boughtVolume ticker • Cancel ratio CanceledVolumeRatio = (cancelVolume) (newVolume) • The logarithm of ticker per VS TickerPerVSLOG = ln (numTicker) (numVS) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 21 Many order Low inventory Many VS usage High cancel ratio
  • 21. Indices for clustering (extracting HFT-MM) • The logarithm of action per ticker ActionsPerTicker = newOrders + changeOrders + (cancelOrders) (numTicker) ActionsPerTickerLOG = ln ActionsPerTicker • Inventory Ratio InventoryRatioABS = 𝑀𝑒𝑑𝑖𝑎𝑛ticker soldVolume ticker − boughtVolume ticker soldVolume ticker + boughtVolume ticker • Cancel ratio CanceledVolumeRatio = (cancelVolume) (newVolume) • The logarithm of ticker per VS TickerPerVSLOG = ln (numTicker) (numVS) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 22
  • 22. Data outline • Aug. 2015: All 21 business days • Before VS merging: 4616 VSs • After VS merging: 2664 VSs • Only HFT: 253 VSs <= based on ActionsPerTicker ≥ 100 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 23 2455 2455 2161 209 253
  • 23. Hierarchical Clustering [Uno et al. 18] • Normalizations for each indices & clustering • Euclidean distance • Ward’s method • 10 clusters 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 24 HFT-MM cluster based on indices
  • 24. Ordering Price Distribution • HFT-MM ordering price distribution = How many ticks far from the last transaction price 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 25 − 5 0 5 10 15 0.0e+0 5.0e+8 1.0e+9 1.5e+9 2.0e+9 2.5e+9 Order Executed Order Ticks Freq.
  • 25. Study Outline 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 26 Data Simulation HFT-MM Order Data HFT-MM Order Data in Simulation Comparison Processing, VS merging, Clustering
  • 26. Ordering Price Distribution − 5 0 5 10 15 0.00 0.20 0.40 0.60 0.80 1.00 Order (Actual) Order (Simulation) Ticks Relative Freq. (vs tick 0) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 27
  • 27. Statistical test: Entropy • T-test for • Entropy for −5~15 tick • Entropy for −2~5 tick • This suggests: • −2~5 tick: simulation & real data has small difference • −5~2, 5~15 tick: simulation & real data has significant diff. 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 28 𝐸 = −𝑝 𝑥 log2 𝑝 𝑥
  • 28. Ordering Price Distribution − 5 0 5 10 15 0.00 0.20 0.40 0.60 0.80 1.00 Order (Actual) Order (Simulation) Ticks Relative Freq. (vs tick 0) 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 29 Long tail: know as “layering”
  • 29. Discussion & Conclusion • Near the best price, simulation and data are similar • => our clustering method work • => our simulation also work • But, our simulation lost some features in real data • Ex. Long tail 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 30 Future work • Build more realistic simulation • Also use data-driven approach for simulation • Build simulation (trader) model automatically • There are limitation for human to build perfect model • Human-made model can drop some features
  • 30. Thank you for your attention! • The paper for social track will be published JASSS. • You can access our preprint on ResearchGate https://s.mhirano.jp/prima2019-preprint • Or contact me: hirano@g.ecc.u-tokyo.ac.jp https://mhirano.jp/ 10/31/19 PRIMA 2019 ©︎M.HIRANO & Izumi Lab. 31