Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Developing High Throughput

Communication Interface For High


Frequency Trading On FPGA’s

By
Abbas Ali (18jzele0237) – Group Leader
Abdullah Shah (18jzele0236)
Malik Abdul Moiz (18jzele0287)
Supervised By
Dr. Malik Umar Sharif
1
Presentation Overview
MACD
-Pseudocode
Comparing the
- Block Diagram Implementation of Implementation of
Execution time of
- Data path MACD on PL MACD in PS
PS & PL
- Controller
- Top Level Design

RSI
-Pseudocode Comparing the Comparing Latencies of
Top 3 Trading Implementation of Implementation of
- Block Diagram Execution time of these three Technical
Algorithms RSI on PL RSI in PS
- Data path PS & PL Indicator
(MACD, RSI & Aroon)
- Controller
- Top Level Design

Aroon
-Pseudocode
- Block Diagram Comparing the
Implementation of Implementation of
- Data path Execution time of
Aroon on PL Aroon in PS
- Controller PS & PL
- Top Level Design

2
ZYNQ Architecture

3
Design Methodology
IEEE 802.3 Ethernet Packet Frame

16 bytes

FCS

Actual data in the packet

4
Design Methodology (Cont.)
1. Software Implementation (PS) 2. Hardware Implementation (PL)
PS PL
PHY
Market
Market
Data Parser
Feed (s) Data Parser
Feed (s) ARM
Ethernet Stock Ethernet IP/
PMA

PMD
Stock CortexA9
PCS

Exchange MAC (Processor) Exchange MAC


Order Signals Order Trading
Trading
(Buy/Sell) Algorithms Signals Algorithms
(Buy/ Sell)

3. Software-Hardware Co-design Implementation (PS-PL)


PHY

PCS- Physical Coding Sublayer


PMA- Physical Medium Attachment Layer
PMD- Physical Medium Dependent Layer

5
Top3 Technical Indicators
 Why we choose these 3 Indicators?
• In the area of High Frequency Trading (HFT),
a lot of work has been done on these 3 indicators.
Market Prediction using these 3 indicators.

6
Working of MACD Algorithm

7
Implementation of MACD

 Pseudocode
EMA = Closing price x multiplier + EMA (previous day) x (1-multiplier)

8
Implementation of MACD (Cont.)

 Datapath

9
Implementation of MACD (Cont.)

 Datapath
(Remaining Part)

10
Working of Aroon Algorithm

Calculation for Aroon

Aroon Oscillator > 0


Buy Signal
Aroon Oscillator < 0
Sell Signal

The Aroon Oscillator value is then plotted on a


graph between 0 and 100.

Gold and Steven “The Viability of Six Popular Technical Analysis Trading Rules in Determining Effective Buy
and Sell Signals: MACD, AROON, RSI, SO, OBV, and ADL” Journal of Applied Financial Research . 2015,
Vol. 2, p8-29. 22p. 11
Implementation of Aroon (Cont.)

Pseudocode
Reference
Gold and Steven “The Viability of Six Popular Technical Analysis Trading Rules in Determining Effective Buy
and Sell Signals: MACD, AROON, RSI, SO, OBV, and ADL” Journal of Applied Financial Research . 2015,
Vol. 2, p8-29. 22p.

12
Implementation of Aroon (Cont.)

 Datapath

13
Implementation of Aroon (Cont.)

 Datapath
(Remaining Part)

14
Working of RSI Algorithm

RSI Calculation
• Identify time period ( 14 days)
• Add up the average gain and average loss
during chosen time
• Divide the average gain by average loss
(Relative Strength).
• The relative strength value is then plotted on
a graph between 0 and 100.

15
Implementation of RSI (Cont.)

Pseudocode
 Alejandro Rodríguez-González, Fernando Guldrís-Iglesias, “
Improving Trading Systems Using the RSI Financial Indicator
and Neural Networks”

16
Implementation of RSI (Cont.)

 Datapath

17
Implementation of RSI (Cont.)

 Datapath
(Remaining Part)

18
Result Section
• From Table 1, we conclude that the MACD gives higher profitably rate of
79.1% & 80.7% for BTC & ETH cryptocurrencies respectively.

19
Result Section (Bitcoin Dataset)

20
Result Section (Bitcoin Dataset)

21
Result Section (Bitcoin Dataset)

22
Result Section (Ethereum Dataset)

23
Result Section (Ethereum Dataset)

24
Result Section (Ethereum Dataset)

25
Comparative Analysis of PS & PL
• To find the execution time of PL, first we have to find the Table 1.
parameters in order to compare the execution time of PS & PL.

26
Comparative Analysis of PS & PL

27
Conclusion
 In this paper, we concluded that
The purpose of this study was to build such platform in which we achieve low latency in
order to improve the efficiency of trading because when low latency achieved then
trading algorithms execute decision order (Buy/Sell) quite faster that’s why most of our
trades becomes profitable and hence we make money from these trades. That’s why we
introduce such hardware platform on ZYNQ SOC over 10 gigabit Ethernet which execute
decision order (Buy/ Sell) quite faster as compare to software.
Compare three trading algorithms (MACD, RSI and Aroon) on Bitcoin and Ethereum
Cryptocurrencies and concluded that MACD gives the low latency of 8.687 us as
compare to other momentum indicators and 18.6 times faster than software while Aroon
is the least fast indicator with the latency of 82.56 us but still 6.3953 times faster than
software.

28
Future Work
 Building a model for better prediction
Currently, we work on the three different momentum technical indicators (MACD, RSI
and Aroon) and proposed a model in which we conclude that MACD performs well as it
gives 79.1% and 80.7% accuracy on different datasets. To improve this accuracy, we
will further work on the MACD algorithms to find the maximum possible accuracy by
doing Critical path analysis.
 Machine Learning Algorithms implementation on FPGA over Gigabit Ethernet
By literature review, we concluded that technical indicators as a trading strategy are not
so powerful as machine learning algorithms because machine learning algorithms can
positively impact the efficiency of the trading. That’s why our next target is to
implement the Machine Learning Algorithms on FPGA over 10 Gigabit Ethernet and
provide such platform for traders to make more money by doing profitable trades. The
machine learning algorithm which we looking for is Support Vector Machine (SVM).

29
FYP-TEAM

30
THANK YOU
&
ANY QUESTION
???

31

You might also like