SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
ALGORITHMIC TRADING
Minor Project
Deb Prakash Ganguly 1401227154
Guided by (ASST PROF.NAMITA BAJPAI)
27,NOVEMBER,2017
C.V RAMAN COLLEGE OF ENGINEERING
.
Algo Trading Short Title 1/23
CONTENTS
• INTRODUCTION
• OBJECTIVE
• SOFTWARE REQUIRED
• ARCHITECTURE
• STRATEGIES
• ALGORITHIM
• OUTPUT GRAPH
• LIMITATIONS
• CONCLUSION
• FUTURE ENHANCEMENT
• REFERENCES
Algo Trading Short Title 2/23
INTRODUCTION
• It is the process of using set of rules or any mathematical
model to generate profits at a high speed frequency that is
impossible for a human trader
• It is simply a way to minimize the cost, market impact and
risk in execution of an order.It is widely used by investment
banks and hedge funds.
Algo Trading Short Title 3/23
OBJECTIVE
• To predict stock prices through lagger indicator.
• Investor will evaluate strategies from a rigorous scientific
perspective to prevent financial crises .
• It will help in portfolio management to make a prediction
individual stocks.
• Trades will be instantly, to avoid significant price changes
Reduced transaction costs or brokerage charge.
• Reduced possibility of mistakes by human traders based
on psychological factors.
Algo Trading Short Title 4/23
SOFTWARE REQUIRED
• Automated trading can be done by c, c++, java script,
ipython, etc.out of which we are using interactive
python(Ipython)
• Most of the quant traders prefer Python algorithmic trading
as it helps them build their own execution mechanisms .
• Python can be used to develop some great treading
platform where using c or c++ is a time consuming job .
• It has packages like Pandas, NumPy, PyAlgoTrade,
MatPlotLib which support google finance, csv files.Are free
of cost.
Algo Trading Short Title 5/23
Interactive python
IPython provides a rich architecture for interactive computing
with:
• A powerful interactive shell.
• A kernel for Jupyter.
• Flexible, amendable interpreters to load into your own
projects.
Algo Trading Short Title 6/23
ARCHITECTURE
• The entire automated trading system can now be broken
down into 3 parts :
• The exchange(s) the external world
• The server
• Market Data receiver
• Store market data
• Store orders generated by the user
• Application
• Take inputs from the user including the trading decisions
• Interface for viewing the information including the data and
orders
• An order manager sending orders to the exchange
Algo Trading Short Title 7/23
Traditional Architecture
Algo Trading Short Title 8/23
NEW ARCHITECTURE
• The traditional architecture could not scale up to the needs
and demands of Automated trading with Direct market
access (DMA).
• The latency between origin of the event to the order
generation went beyond the dimension of human control .
• Order management also needs to be more robust and
capable of handling many more orders per second.
Algo Trading Short Title 9/23
• The infrastructure level of this module is superior
compared to traditional system . Hence the engine which
runs the logic of decision making,is known as the Complex
Event Processing engine, or CEP .
• The risk checks are performed now by a separate Risk
Management System (RMS) within the Order Manager
(OM), just before releasing an order.
Algo Trading Short Title 10/23
Algo Trading Short Title 11/23
• The new architecture was capable of scaling to many
strategies per server, the need to connect to multiple
destinations from a single server emerged.
• The order manager hosted several adapters to send orders
to multiple destinations and receive data from multiple
exchanges.
• To avoid this hassle of adapter addition, standard protocols
have been designed. The most prominent among them is
the FIX (Financial Information Exchange) .
Algo Trading Short Title 12/23
Automated trading Strategies
As per the new architecture is capable of scaling too many
strategies out of which we apply 2 of them .
• Simple Moving Average (SMA)
• The simple moving average is the simplest type of moving
average.
• It is arguably the most popular technical analysis tool used
by traders.
• A simple (or arithmetic) moving average is an arithmetic
moving average calculated by adding the elements in a time
series and dividing this total by the number of time periods.
• [SMA = (Sum of data points in the moving average
period)/(Total number of periods)]
Algo Trading Short Title 13/23
• Exponential Moving Average (EMA or EWMA)
• The simple moving averages are sometimes too simple and
do not work well when there are spikes in the price of the
security. Exponential moving averages give more weight to
the most recent periods. This makes them more reliable
than the SMA and a better representation of the recent
performance of the security.
• alpha = 0.1 to 0.3 [ EMA = (Closing price minus EMA of
previous day/bar) x alpha) + EMA of previous day/bar
Rewritten as: EMA = (Closing price) x alpha + (EMA of
previous day/bar) x (1 minus multiplier)
Algo Trading Short Title 14/23
Algorithm
• Step 1:- Start
• Step 2:- Import packages
• Step 3:-Request for API
• Step 4:-Retrive access token
• Step 5:-Request trade segment in NSE or BSE
• Step 6:-Request for history data for a particular script from
NSE
Algo Trading Short Title 15/23
Algorithm
• Step 7:- Slicing dataframe.
• Step 8:- converting dataframe to csv file.
• Step 9:- calculation SMA[ n/n].
• Step 10:- calculation
EMA[(alpha*prev.close)+(1-alpha*prev.ema)
where alpha=( 2/1-n).
• Step 11:- Cal. EMA for 5,8 and 13 days.
• Step 12:- Convert all csv data to dataframe.
Algo Trading Short Title 16/23
Algorithm
• Step 13:- Plotting graph through dataframe.
• Step 14:- By using euclidean formula, distance between
two lines[dist((x, y), (a, b)) = (x − a)2 + (y − b)2]
• Step 15:- Cal.risk line= [dist((x, y), (a, b)) - [dist((x1, y1),
(a1, b1))
• Step 16:- If risk line == 0, check if (x,y) >(x1,y1) generate
’BUY’ signal else ’SELL’.
Algo Trading Short Title 17/23
Output Graph
Algo Trading Short Title 18/23
Analysis
Algo Trading Short Title 19/23
Limitations
• Algorithmic trading is not 100 percent accurate.We just
predict future stock price basis upon past stock behaviour.
• Algorithmic trading is not universal. one algorithm cannot
be applied to every situation.
• Investor has to check daily news or updates of individual
script.
• Due to this market goes to more volatility.
Algo Trading Short Title 20/23
Conclusion
Trading is extremely difficult for both full time and especially part
time traders.The best road to gain profit is finding your own
trading strategies.Once you got it, is your goals and
objectives.No,trading strategies lasts forever and i find myself
constantly reinventing my strategy.I learned all of these
lessons,and many more from trade academy during my
internship.
Algo Trading Short Title 21/23
Future Enhancement
In year of 2008 SEBI started allowing DMA.In the US and other
developed markets HFT estimated 70 percentage of equity
market share.In India is around 12 percentage. As technology
is growing,financial technology is growing up same space.
In recent years,the number of machine learning packages has
increased in finance trading. some established funds like
Medallion,Citadel,JPmorgan using artificial intelligence, and
there performance is in peak level.
Upcoming years algo trading with AI power will have a huge
impact in Indian market.
Algo Trading Short Title 22/23
References
• Fundamental of dataframe by Yves Hilpisch,2016, p.137
• API connection
website:https://github.com/upstox/upstox-python
• Algo Trading architecture
https://www.quantinsti.com/blog/trading-systems-
architecture
Algo Trading Short Title 23/23

Contenu connexe

Tendances

Technical indicators
Technical indicatorsTechnical indicators
Technical indicators
vermaayushi
 
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
QuantInsti
 

Tendances (20)

Algo trading with machine learning ppt
Algo trading with machine learning pptAlgo trading with machine learning ppt
Algo trading with machine learning ppt
 
The Impact of Algorithmic Trading
The Impact of Algorithmic TradingThe Impact of Algorithmic Trading
The Impact of Algorithmic Trading
 
Algorithmic trading
Algorithmic tradingAlgorithmic trading
Algorithmic trading
 
How to build a trading system
How to build a trading systemHow to build a trading system
How to build a trading system
 
Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!Quant insti webinar on algorithmic trading for technocrats!
Quant insti webinar on algorithmic trading for technocrats!
 
BUILDING AUTOMATED TRADING STRATEGIES
BUILDING AUTOMATED TRADING STRATEGIESBUILDING AUTOMATED TRADING STRATEGIES
BUILDING AUTOMATED TRADING STRATEGIES
 
Statistical arbitrage
Statistical arbitrageStatistical arbitrage
Statistical arbitrage
 
Classification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar pptClassification of quantitative trading strategies webinar ppt
Classification of quantitative trading strategies webinar ppt
 
Order book dynamics in high frequency trading
Order book dynamics in high frequency tradingOrder book dynamics in high frequency trading
Order book dynamics in high frequency trading
 
Technical indicators
Technical indicatorsTechnical indicators
Technical indicators
 
Stock and Share Market Technical Analysis
Stock and Share Market Technical AnalysisStock and Share Market Technical Analysis
Stock and Share Market Technical Analysis
 
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
 
Profit from trapped traders with 2 simple setups
Profit from trapped traders with 2 simple setupsProfit from trapped traders with 2 simple setups
Profit from trapped traders with 2 simple setups
 
"Build Effective Risk Management on Top of Your Trading Strategy" by Danielle...
"Build Effective Risk Management on Top of Your Trading Strategy" by Danielle..."Build Effective Risk Management on Top of Your Trading Strategy" by Danielle...
"Build Effective Risk Management on Top of Your Trading Strategy" by Danielle...
 
QuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs TradingQuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs Trading
 
Option Trading Strategy: Reverse Gamma Scalping
Option Trading Strategy: Reverse Gamma ScalpingOption Trading Strategy: Reverse Gamma Scalping
Option Trading Strategy: Reverse Gamma Scalping
 
Trading plan
Trading planTrading plan
Trading plan
 
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ..."How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
"How to Run a Quantitative Trading Business in China with Python" by Xiaoyou ...
 
Treasury Managemen Systems (TMS) - Calypso
Treasury Managemen Systems (TMS) - CalypsoTreasury Managemen Systems (TMS) - Calypso
Treasury Managemen Systems (TMS) - Calypso
 
Trading Strategy
Trading StrategyTrading Strategy
Trading Strategy
 

Similaire à Algo trading(Minor Project) strategy EMA with Ipython

Sungard Global trading Presentation
Sungard Global trading PresentationSungard Global trading Presentation
Sungard Global trading Presentation
ahemeury
 
Predictive automated marginal trading technology pamtt part 4
Predictive automated marginal trading technology  pamtt part 4Predictive automated marginal trading technology  pamtt part 4
Predictive automated marginal trading technology pamtt part 4
Yuri Martemianov
 
Predictive automated marginal trading technology pamtt part 1
Predictive automated marginal trading technology   pamtt part 1 Predictive automated marginal trading technology   pamtt part 1
Predictive automated marginal trading technology pamtt part 1
Yuri Martemianov
 

Similaire à Algo trading(Minor Project) strategy EMA with Ipython (20)

Stock Market Prediction.pptx
Stock Market Prediction.pptxStock Market Prediction.pptx
Stock Market Prediction.pptx
 
High-Frequency Trading in Stock Market
High-Frequency Trading in Stock MarketHigh-Frequency Trading in Stock Market
High-Frequency Trading in Stock Market
 
Manish final report
Manish final reportManish final report
Manish final report
 
Scalping strategies for Forex trading
Scalping strategies for Forex tradingScalping strategies for Forex trading
Scalping strategies for Forex trading
 
Building A Trading Desk On Analytics
Building A Trading Desk On AnalyticsBuilding A Trading Desk On Analytics
Building A Trading Desk On Analytics
 
Adaptix_2013
Adaptix_2013Adaptix_2013
Adaptix_2013
 
Trading Analytics
Trading AnalyticsTrading Analytics
Trading Analytics
 
How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?How to design quant trading strategies using “R”?
How to design quant trading strategies using “R”?
 
StrategyDB Introductory Presentation English
StrategyDB Introductory Presentation EnglishStrategyDB Introductory Presentation English
StrategyDB Introductory Presentation English
 
Sungard Global trading Presentation
Sungard Global trading PresentationSungard Global trading Presentation
Sungard Global trading Presentation
 
Predictive automated marginal trading technology pamtt part 4
Predictive automated marginal trading technology  pamtt part 4Predictive automated marginal trading technology  pamtt part 4
Predictive automated marginal trading technology pamtt part 4
 
Algorithmic Trading and its Impact on the Market
Algorithmic Trading and its Impact on the MarketAlgorithmic Trading and its Impact on the Market
Algorithmic Trading and its Impact on the Market
 
BlitzTrader_PPT
BlitzTrader_PPTBlitzTrader_PPT
BlitzTrader_PPT
 
Predictive automated marginal trading technology pamtt part 1
Predictive automated marginal trading technology   pamtt part 1 Predictive automated marginal trading technology   pamtt part 1
Predictive automated marginal trading technology pamtt part 1
 
Ecetera uses Splunk to facilitate DevOps in forex
Ecetera uses Splunk to facilitate DevOps in forexEcetera uses Splunk to facilitate DevOps in forex
Ecetera uses Splunk to facilitate DevOps in forex
 
Wall Street Derivative Risk Solutions Using Apache Geode
Wall Street Derivative Risk Solutions Using Apache GeodeWall Street Derivative Risk Solutions Using Apache Geode
Wall Street Derivative Risk Solutions Using Apache Geode
 
Wall Street Derivative Risk Solutions Using Geode
Wall Street Derivative Risk Solutions Using GeodeWall Street Derivative Risk Solutions Using Geode
Wall Street Derivative Risk Solutions Using Geode
 
#GeodeSummit - Wall St. Derivative Risk Solutions Using Geode
#GeodeSummit - Wall St. Derivative Risk Solutions Using Geode#GeodeSummit - Wall St. Derivative Risk Solutions Using Geode
#GeodeSummit - Wall St. Derivative Risk Solutions Using Geode
 
Building Wall St Risk Systems with Apache Geode
Building Wall St Risk Systems with Apache GeodeBuilding Wall St Risk Systems with Apache Geode
Building Wall St Risk Systems with Apache Geode
 
Go Observability (in practice)
Go Observability (in practice)Go Observability (in practice)
Go Observability (in practice)
 

Dernier

Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Solution Manual For Financial Statement Analysis, 13th Edition By Charles H. ...
Solution Manual For Financial Statement Analysis, 13th Edition By Charles H. ...Solution Manual For Financial Statement Analysis, 13th Edition By Charles H. ...
Solution Manual For Financial Statement Analysis, 13th Edition By Charles H. ...
 
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsMahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
Collecting banker, Capacity of collecting Banker, conditions under section 13...
Collecting banker, Capacity of collecting Banker, conditions under section 13...Collecting banker, Capacity of collecting Banker, conditions under section 13...
Collecting banker, Capacity of collecting Banker, conditions under section 13...
 
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
 
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
Kopar Khairane Cheapest Call Girls✔✔✔9833754194 Nerul Premium Call Girls-Navi...
 
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
 
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
Certified Kala Jadu, Black magic specialist in Rawalpindi and Bangali Amil ba...
 
logistics industry development power point ppt.pdf
logistics industry development power point ppt.pdflogistics industry development power point ppt.pdf
logistics industry development power point ppt.pdf
 
Fixed exchange rate and flexible exchange rate.pptx
Fixed exchange rate and flexible exchange rate.pptxFixed exchange rate and flexible exchange rate.pptx
Fixed exchange rate and flexible exchange rate.pptx
 
Benefits & Risk Of Stock Loans
Benefits & Risk Of Stock LoansBenefits & Risk Of Stock Loans
Benefits & Risk Of Stock Loans
 
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
 
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
 
Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...Test bank for advanced assessment interpreting findings and formulating diffe...
Test bank for advanced assessment interpreting findings and formulating diffe...
 
Pension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdfPension dashboards forum 1 May 2024 (1).pdf
Pension dashboards forum 1 May 2024 (1).pdf
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
7 steps to achieve financial freedom.pdf
7 steps to achieve financial freedom.pdf7 steps to achieve financial freedom.pdf
7 steps to achieve financial freedom.pdf
 
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
In Sharjah ௵(+971)558539980 *_௵abortion pills now available.
 
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
✂️ 👅 Independent Bhubaneswar Escorts Odisha Call Girls With Room Bhubaneswar ...
 

Algo trading(Minor Project) strategy EMA with Ipython

  • 1. ALGORITHMIC TRADING Minor Project Deb Prakash Ganguly 1401227154 Guided by (ASST PROF.NAMITA BAJPAI) 27,NOVEMBER,2017 C.V RAMAN COLLEGE OF ENGINEERING . Algo Trading Short Title 1/23
  • 2. CONTENTS • INTRODUCTION • OBJECTIVE • SOFTWARE REQUIRED • ARCHITECTURE • STRATEGIES • ALGORITHIM • OUTPUT GRAPH • LIMITATIONS • CONCLUSION • FUTURE ENHANCEMENT • REFERENCES Algo Trading Short Title 2/23
  • 3. INTRODUCTION • It is the process of using set of rules or any mathematical model to generate profits at a high speed frequency that is impossible for a human trader • It is simply a way to minimize the cost, market impact and risk in execution of an order.It is widely used by investment banks and hedge funds. Algo Trading Short Title 3/23
  • 4. OBJECTIVE • To predict stock prices through lagger indicator. • Investor will evaluate strategies from a rigorous scientific perspective to prevent financial crises . • It will help in portfolio management to make a prediction individual stocks. • Trades will be instantly, to avoid significant price changes Reduced transaction costs or brokerage charge. • Reduced possibility of mistakes by human traders based on psychological factors. Algo Trading Short Title 4/23
  • 5. SOFTWARE REQUIRED • Automated trading can be done by c, c++, java script, ipython, etc.out of which we are using interactive python(Ipython) • Most of the quant traders prefer Python algorithmic trading as it helps them build their own execution mechanisms . • Python can be used to develop some great treading platform where using c or c++ is a time consuming job . • It has packages like Pandas, NumPy, PyAlgoTrade, MatPlotLib which support google finance, csv files.Are free of cost. Algo Trading Short Title 5/23
  • 6. Interactive python IPython provides a rich architecture for interactive computing with: • A powerful interactive shell. • A kernel for Jupyter. • Flexible, amendable interpreters to load into your own projects. Algo Trading Short Title 6/23
  • 7. ARCHITECTURE • The entire automated trading system can now be broken down into 3 parts : • The exchange(s) the external world • The server • Market Data receiver • Store market data • Store orders generated by the user • Application • Take inputs from the user including the trading decisions • Interface for viewing the information including the data and orders • An order manager sending orders to the exchange Algo Trading Short Title 7/23
  • 9. NEW ARCHITECTURE • The traditional architecture could not scale up to the needs and demands of Automated trading with Direct market access (DMA). • The latency between origin of the event to the order generation went beyond the dimension of human control . • Order management also needs to be more robust and capable of handling many more orders per second. Algo Trading Short Title 9/23
  • 10. • The infrastructure level of this module is superior compared to traditional system . Hence the engine which runs the logic of decision making,is known as the Complex Event Processing engine, or CEP . • The risk checks are performed now by a separate Risk Management System (RMS) within the Order Manager (OM), just before releasing an order. Algo Trading Short Title 10/23
  • 11. Algo Trading Short Title 11/23
  • 12. • The new architecture was capable of scaling to many strategies per server, the need to connect to multiple destinations from a single server emerged. • The order manager hosted several adapters to send orders to multiple destinations and receive data from multiple exchanges. • To avoid this hassle of adapter addition, standard protocols have been designed. The most prominent among them is the FIX (Financial Information Exchange) . Algo Trading Short Title 12/23
  • 13. Automated trading Strategies As per the new architecture is capable of scaling too many strategies out of which we apply 2 of them . • Simple Moving Average (SMA) • The simple moving average is the simplest type of moving average. • It is arguably the most popular technical analysis tool used by traders. • A simple (or arithmetic) moving average is an arithmetic moving average calculated by adding the elements in a time series and dividing this total by the number of time periods. • [SMA = (Sum of data points in the moving average period)/(Total number of periods)] Algo Trading Short Title 13/23
  • 14. • Exponential Moving Average (EMA or EWMA) • The simple moving averages are sometimes too simple and do not work well when there are spikes in the price of the security. Exponential moving averages give more weight to the most recent periods. This makes them more reliable than the SMA and a better representation of the recent performance of the security. • alpha = 0.1 to 0.3 [ EMA = (Closing price minus EMA of previous day/bar) x alpha) + EMA of previous day/bar Rewritten as: EMA = (Closing price) x alpha + (EMA of previous day/bar) x (1 minus multiplier) Algo Trading Short Title 14/23
  • 15. Algorithm • Step 1:- Start • Step 2:- Import packages • Step 3:-Request for API • Step 4:-Retrive access token • Step 5:-Request trade segment in NSE or BSE • Step 6:-Request for history data for a particular script from NSE Algo Trading Short Title 15/23
  • 16. Algorithm • Step 7:- Slicing dataframe. • Step 8:- converting dataframe to csv file. • Step 9:- calculation SMA[ n/n]. • Step 10:- calculation EMA[(alpha*prev.close)+(1-alpha*prev.ema) where alpha=( 2/1-n). • Step 11:- Cal. EMA for 5,8 and 13 days. • Step 12:- Convert all csv data to dataframe. Algo Trading Short Title 16/23
  • 17. Algorithm • Step 13:- Plotting graph through dataframe. • Step 14:- By using euclidean formula, distance between two lines[dist((x, y), (a, b)) = (x − a)2 + (y − b)2] • Step 15:- Cal.risk line= [dist((x, y), (a, b)) - [dist((x1, y1), (a1, b1)) • Step 16:- If risk line == 0, check if (x,y) >(x1,y1) generate ’BUY’ signal else ’SELL’. Algo Trading Short Title 17/23
  • 18. Output Graph Algo Trading Short Title 18/23
  • 20. Limitations • Algorithmic trading is not 100 percent accurate.We just predict future stock price basis upon past stock behaviour. • Algorithmic trading is not universal. one algorithm cannot be applied to every situation. • Investor has to check daily news or updates of individual script. • Due to this market goes to more volatility. Algo Trading Short Title 20/23
  • 21. Conclusion Trading is extremely difficult for both full time and especially part time traders.The best road to gain profit is finding your own trading strategies.Once you got it, is your goals and objectives.No,trading strategies lasts forever and i find myself constantly reinventing my strategy.I learned all of these lessons,and many more from trade academy during my internship. Algo Trading Short Title 21/23
  • 22. Future Enhancement In year of 2008 SEBI started allowing DMA.In the US and other developed markets HFT estimated 70 percentage of equity market share.In India is around 12 percentage. As technology is growing,financial technology is growing up same space. In recent years,the number of machine learning packages has increased in finance trading. some established funds like Medallion,Citadel,JPmorgan using artificial intelligence, and there performance is in peak level. Upcoming years algo trading with AI power will have a huge impact in Indian market. Algo Trading Short Title 22/23
  • 23. References • Fundamental of dataframe by Yves Hilpisch,2016, p.137 • API connection website:https://github.com/upstox/upstox-python • Algo Trading architecture https://www.quantinsti.com/blog/trading-systems- architecture Algo Trading Short Title 23/23