SlideShare a Scribd company logo
1 of 23
Download to read offline
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

More Related Content

What's hot

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 pptQuantInsti
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016Quantopian
 
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...Professional Training Academy
 
High frequency trading
High frequency tradingHigh frequency trading
High frequency tradingŞaban Dalaman
 
Algo trading with machine learning ppt
Algo trading with machine learning pptAlgo trading with machine learning ppt
Algo trading with machine learning pptDeb prakash ganguly
 
Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)Adrian Aley
 
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...Quantopian
 
Technical analysis Fundamentals
Technical analysis FundamentalsTechnical analysis Fundamentals
Technical analysis Fundamentalsn_ibs
 
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas..."Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...Quantopian
 
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an..."Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...Quantopian
 
Paradigms of trading strategies formulation
Paradigms of trading strategies formulationParadigms of trading strategies formulation
Paradigms of trading strategies formulationQuantInsti
 
Managing an Option Portfolio and how Automated Trading makes it easier
Managing an Option Portfolio and how Automated Trading makes it easierManaging an Option Portfolio and how Automated Trading makes it easier
Managing an Option Portfolio and how Automated Trading makes it easierQuantInsti
 
Trading edge for the forex market
Trading edge for the forex marketTrading edge for the forex market
Trading edge for the forex marketlcchong76
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...Quantopian
 
Securities Trade Life Cycle
Securities Trade Life CycleSecurities Trade Life Cycle
Securities Trade Life CycleKhader Shaik
 
Technical Analysis
Technical AnalysisTechnical Analysis
Technical Analysisluv_sharma
 
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
 

What's hot (20)

Algo trading
Algo tradingAlgo trading
Algo trading
 
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
 
Algonell - Pitch
Algonell - PitchAlgonell - Pitch
Algonell - Pitch
 
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
A Guided Tour of Machine Learning for Traders by Tucker Balch at QuantCon 2016
 
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...
Behavioural Finance - CHAPTER 18 – The Anatomy of a Bubble | CMT Level 3 | Ch...
 
High frequency trading
High frequency tradingHigh frequency trading
High frequency trading
 
Algo trading with machine learning ppt
Algo trading with machine learning pptAlgo trading with machine learning ppt
Algo trading with machine learning ppt
 
Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)Intro to Quant Trading Strategies (Lecture 1 of 10)
Intro to Quant Trading Strategies (Lecture 1 of 10)
 
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
Automated Selection and Robustness for Systematic Trading Strategies by Dr. T...
 
Technical analysis Fundamentals
Technical analysis FundamentalsTechnical analysis Fundamentals
Technical analysis Fundamentals
 
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas..."Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
"Quant Trading for a Living – Lessons from a Life in the Trenches" by Andreas...
 
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an..."Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
"Quantitative Trading as a Mathematical Science" by Dr. Haksun Li, Founder an...
 
Paradigms of trading strategies formulation
Paradigms of trading strategies formulationParadigms of trading strategies formulation
Paradigms of trading strategies formulation
 
Managing an Option Portfolio and how Automated Trading makes it easier
Managing an Option Portfolio and how Automated Trading makes it easierManaging an Option Portfolio and how Automated Trading makes it easier
Managing an Option Portfolio and how Automated Trading makes it easier
 
Trading edge for the forex market
Trading edge for the forex marketTrading edge for the forex market
Trading edge for the forex market
 
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ..."A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
"A Framework-Based Approach to Building Quantitative Trading Systems" by Dr. ...
 
Securities Trade Life Cycle
Securities Trade Life CycleSecurities Trade Life Cycle
Securities Trade Life Cycle
 
Technical Analysis
Technical AnalysisTechnical Analysis
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...
 
Section I - CH 4 - Practical Considerations.pdf
Section I - CH 4 - Practical Considerations.pdfSection I - CH 4 - Practical Considerations.pdf
Section I - CH 4 - Practical Considerations.pdf
 

Similar to Algo trading(Minor Project) strategy EMA with Ipython

Stock Market Prediction.pptx
Stock Market Prediction.pptxStock Market Prediction.pptx
Stock Market Prediction.pptxRastogiAman
 
High-Frequency Trading in Stock Market
High-Frequency Trading in Stock MarketHigh-Frequency Trading in Stock Market
High-Frequency Trading in Stock MarketIRJET Journal
 
Manish final report
Manish final reportManish final report
Manish final reportmanish8285
 
Scalping strategies for Forex trading
Scalping strategies for Forex tradingScalping strategies for Forex trading
Scalping strategies for Forex tradingJIANG ZUOXIAN
 
Building A Trading Desk On Analytics
Building A Trading Desk On AnalyticsBuilding A Trading Desk On Analytics
Building A Trading Desk On AnalyticsRory Winston
 
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”?QuantInsti
 
Sungard Global trading Presentation
Sungard Global trading PresentationSungard Global trading Presentation
Sungard Global trading Presentationahemeury
 
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 4Yuri Martemianov
 
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 MarketIRJET Journal
 
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
 
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 forexOcean Software
 
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 GeodeAndre Langevin
 
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 GeodeVMware Tanzu
 
#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 GeodePivotalOpenSourceHub
 
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 GeodeAndre Langevin
 

Similar to Algo trading(Minor Project) strategy EMA with Ipython (20)

Algorithmic trading
Algorithmic tradingAlgorithmic trading
Algorithmic trading
 
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
 

Recently uploaded

VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Roomdivyansh0kumar0
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarHarsh Kumar
 
Attachment Of Assets......................
Attachment Of Assets......................Attachment Of Assets......................
Attachment Of Assets......................AmanBajaj36
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Modelshematsharma006
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
 
House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHenry Tapper
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfshaunmashale756
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfHenry Tapper
 
20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdfAdnet Communications
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free DeliveryPooja Nehwal
 
Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Avanish Goel
 
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfAdnet Communications
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...Suhani Kapoor
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Commonwealth
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
fca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdffca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdfHenry Tapper
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...yordanosyohannes2
 
Unveiling the Top Chartered Accountants in India and Their Staggering Net Worth
Unveiling the Top Chartered Accountants in India and Their Staggering Net WorthUnveiling the Top Chartered Accountants in India and Their Staggering Net Worth
Unveiling the Top Chartered Accountants in India and Their Staggering Net WorthShaheen Kumar
 

Recently uploaded (20)

VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh Kumar
 
Attachment Of Assets......................
Attachment Of Assets......................Attachment Of Assets......................
Attachment Of Assets......................
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Models
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
 
House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview document
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdf
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
 
20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf20240417-Calibre-April-2024-Investor-Presentation.pdf
20240417-Calibre-April-2024-Investor-Presentation.pdf
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
 
Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...
 
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Saharanpur Anushka 8250192130 Independent Escort Se...
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdf
 
Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
fca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdffca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdf
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
 
Unveiling the Top Chartered Accountants in India and Their Staggering Net Worth
Unveiling the Top Chartered Accountants in India and Their Staggering Net WorthUnveiling the Top Chartered Accountants in India and Their Staggering Net Worth
Unveiling the Top Chartered Accountants in India and Their Staggering Net Worth
 

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