SlideShare a Scribd company logo
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

Algorithmic Trading
Algorithmic TradingAlgorithmic Trading
Algorithmic Trading
Alice Chan
 
Algorithmic Trading: an Overview
Algorithmic Trading: an Overview Algorithmic Trading: an Overview
Algorithmic Trading: an Overview
EXANTE
 
The Impact of Algorithmic Trading
The Impact of Algorithmic TradingThe Impact of Algorithmic Trading
The Impact of Algorithmic Trading
Lov Loothra
 
What we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fundWhat we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fund
Yingdan (Mora) Liang
 
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
 
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe..."Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
Quantopian
 
QuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs TradingQuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs Trading
QuantConnect
 
"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 ...
Quantopian
 
Yield Curve Trading Strategies
Yield Curve Trading Strategies Yield Curve Trading Strategies
Yield Curve Trading Strategies
Online Finance Academy
 
Forex trading strategies
Forex trading strategiesForex trading strategies
Forex trading strategies
IFC Markets Corp.
 
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D..."From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
Quantopian
 
LC's Forex Trading System
LC's Forex Trading SystemLC's Forex Trading System
LC's Forex Trading System
lcchong76
 
Guide to OTC Trading
Guide to OTC TradingGuide to OTC Trading
Guide to OTC Trading
Ruben Garcia Navarro
 
Testing trading strategies in JavaScript
Testing trading strategies in JavaScriptTesting trading strategies in JavaScript
Testing trading strategies in JavaScript
Ashley Davis
 
Core Master Trading Strategies
Core Master Trading StrategiesCore Master Trading Strategies
Core Master Trading Strategies
Online Finance Academy
 
A Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading SetupsA Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading Setups
InvestingWithOptions
 
"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
Quantitative TradingQuantitative Trading
Quantitative Trading
futurewardcentral
 
CANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdfCANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdf
JustscribblemeForfun
 

What's hot (20)

Algorithmic Trading
Algorithmic TradingAlgorithmic Trading
Algorithmic Trading
 
Algorithmic Trading: an Overview
Algorithmic Trading: an Overview Algorithmic Trading: an Overview
Algorithmic Trading: an Overview
 
Algorithmic Trading
Algorithmic TradingAlgorithmic Trading
Algorithmic Trading
 
The Impact of Algorithmic Trading
The Impact of Algorithmic TradingThe Impact of Algorithmic Trading
The Impact of Algorithmic Trading
 
What we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fundWhat we learned from running a quant crypto hedge fund
What we learned from running a quant crypto hedge fund
 
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...
 
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe..."Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
 
QuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs TradingQuantConnect - Introduction to Pairs Trading
QuantConnect - Introduction to Pairs Trading
 
"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 ...
 
Yield Curve Trading Strategies
Yield Curve Trading Strategies Yield Curve Trading Strategies
Yield Curve Trading Strategies
 
Forex trading strategies
Forex trading strategiesForex trading strategies
Forex trading strategies
 
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D..."From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
"From Alpha Discovery to Portfolio Construction: Pitfalls and Solutions" by D...
 
LC's Forex Trading System
LC's Forex Trading SystemLC's Forex Trading System
LC's Forex Trading System
 
Guide to OTC Trading
Guide to OTC TradingGuide to OTC Trading
Guide to OTC Trading
 
Testing trading strategies in JavaScript
Testing trading strategies in JavaScriptTesting trading strategies in JavaScript
Testing trading strategies in JavaScript
 
Core Master Trading Strategies
Core Master Trading StrategiesCore Master Trading Strategies
Core Master Trading Strategies
 
A Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading SetupsA Look Back at 11 Stock Trading Setups
A Look Back at 11 Stock Trading Setups
 
"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
Quantitative TradingQuantitative Trading
Quantitative Trading
 
CANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdfCANDLESTICK PROFITS.pdf
CANDLESTICK PROFITS.pdf
 

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

Algorithmic trading
Algorithmic tradingAlgorithmic trading
Algorithmic trading
Jayadeep Govindu
 
Stock Market Prediction.pptx
Stock Market Prediction.pptxStock Market Prediction.pptx
Stock Market Prediction.pptx
RastogiAman
 
High-Frequency Trading in Stock Market
High-Frequency Trading in Stock MarketHigh-Frequency Trading in Stock Market
High-Frequency Trading in Stock Market
IRJET Journal
 
Manish final report
Manish final reportManish final report
Manish final report
manish8285
 
Scalping strategies for Forex trading
Scalping strategies for Forex tradingScalping strategies for Forex trading
Scalping strategies for Forex trading
JIANG ZUOXIAN
 
Building A Trading Desk On Analytics
Building A Trading Desk On AnalyticsBuilding A Trading Desk On Analytics
Building A Trading Desk On Analytics
Rory Winston
 
Trading Analytics
Trading AnalyticsTrading Analytics
Trading Analytics
RoryWinston1
 
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
 
StrategyDB Introductory Presentation English
StrategyDB Introductory Presentation EnglishStrategyDB Introductory Presentation English
StrategyDB Introductory Presentation English
StrategyDB - Trading Intellilgence
 
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 Market
IRJET 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 forex
Ocean 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 Geode
Andre 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 Geode
VMware Tanzu
 
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
Andre Langevin
 
#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
PivotalOpenSourceHub
 

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
 
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
 
#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
 

Recently uploaded

Financial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptxFinancial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptx
Writo-Finance
 
US Economic Outlook - Being Decided - M Capital Group August 2021.pdf
US Economic Outlook - Being Decided - M Capital Group August 2021.pdfUS Economic Outlook - Being Decided - M Capital Group August 2021.pdf
US Economic Outlook - Being Decided - M Capital Group August 2021.pdf
pchutichetpong
 
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
muslimdavidovich670
 
when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.
DOT TECH
 
Chương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdfChương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdf
va2132004
 
655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf
morearsh02
 
BYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptxBYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptx
mikemetalprod
 
How to get verified on Coinbase Account?_.docx
How to get verified on Coinbase Account?_.docxHow to get verified on Coinbase Account?_.docx
How to get verified on Coinbase Account?_.docx
Buy bitget
 
how to sell pi coins in South Korea profitably.
how to sell pi coins in South Korea profitably.how to sell pi coins in South Korea profitably.
how to sell pi coins in South Korea profitably.
DOT TECH
 
What website can I sell pi coins securely.
What website can I sell pi coins securely.What website can I sell pi coins securely.
What website can I sell pi coins securely.
DOT TECH
 
how to sell pi coins on Binance exchange
how to sell pi coins on Binance exchangehow to sell pi coins on Binance exchange
how to sell pi coins on Binance exchange
DOT TECH
 
Introduction to Value Added Tax System.ppt
Introduction to Value Added Tax System.pptIntroduction to Value Added Tax System.ppt
Introduction to Value Added Tax System.ppt
VishnuVenugopal84
 
managementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.pptmanagementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.ppt
SuseelaPalanimuthu
 
what is the future of Pi Network currency.
what is the future of Pi Network currency.what is the future of Pi Network currency.
what is the future of Pi Network currency.
DOT TECH
 
GeM ppt in railway for presentation on gem
GeM ppt in railway  for presentation on gemGeM ppt in railway  for presentation on gem
GeM ppt in railway for presentation on gem
CwierAsn
 
where can I find a legit pi merchant online
where can I find a legit pi merchant onlinewhere can I find a legit pi merchant online
where can I find a legit pi merchant online
DOT TECH
 
USDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptxUSDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptx
marketing367770
 
what is a pi whale and how to access one.
what is a pi whale and how to access one.what is a pi whale and how to access one.
what is a pi whale and how to access one.
DOT TECH
 
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit CardPoonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
nickysharmasucks
 
how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.
DOT TECH
 

Recently uploaded (20)

Financial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptxFinancial Assets: Debit vs Equity Securities.pptx
Financial Assets: Debit vs Equity Securities.pptx
 
US Economic Outlook - Being Decided - M Capital Group August 2021.pdf
US Economic Outlook - Being Decided - M Capital Group August 2021.pdfUS Economic Outlook - Being Decided - M Capital Group August 2021.pdf
US Economic Outlook - Being Decided - M Capital Group August 2021.pdf
 
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
The WhatsPump Pseudonym Problem and the Hilarious Downfall of Artificial Enga...
 
when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.
 
Chương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdfChương 6. Ancol - phenol - ether (1).pdf
Chương 6. Ancol - phenol - ether (1).pdf
 
655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf655264371-checkpoint-science-past-papers-april-2023.pdf
655264371-checkpoint-science-past-papers-april-2023.pdf
 
BYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptxBYD SWOT Analysis and In-Depth Insights 2024.pptx
BYD SWOT Analysis and In-Depth Insights 2024.pptx
 
How to get verified on Coinbase Account?_.docx
How to get verified on Coinbase Account?_.docxHow to get verified on Coinbase Account?_.docx
How to get verified on Coinbase Account?_.docx
 
how to sell pi coins in South Korea profitably.
how to sell pi coins in South Korea profitably.how to sell pi coins in South Korea profitably.
how to sell pi coins in South Korea profitably.
 
What website can I sell pi coins securely.
What website can I sell pi coins securely.What website can I sell pi coins securely.
What website can I sell pi coins securely.
 
how to sell pi coins on Binance exchange
how to sell pi coins on Binance exchangehow to sell pi coins on Binance exchange
how to sell pi coins on Binance exchange
 
Introduction to Value Added Tax System.ppt
Introduction to Value Added Tax System.pptIntroduction to Value Added Tax System.ppt
Introduction to Value Added Tax System.ppt
 
managementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.pptmanagementaccountingunitiv-230422140105-dd17d80b.ppt
managementaccountingunitiv-230422140105-dd17d80b.ppt
 
what is the future of Pi Network currency.
what is the future of Pi Network currency.what is the future of Pi Network currency.
what is the future of Pi Network currency.
 
GeM ppt in railway for presentation on gem
GeM ppt in railway  for presentation on gemGeM ppt in railway  for presentation on gem
GeM ppt in railway for presentation on gem
 
where can I find a legit pi merchant online
where can I find a legit pi merchant onlinewhere can I find a legit pi merchant online
where can I find a legit pi merchant online
 
USDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptxUSDA Loans in California: A Comprehensive Overview.pptx
USDA Loans in California: A Comprehensive Overview.pptx
 
what is a pi whale and how to access one.
what is a pi whale and how to access one.what is a pi whale and how to access one.
what is a pi whale and how to access one.
 
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit CardPoonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
Poonawalla Fincorp and IndusInd Bank Introduce New Co-Branded Credit Card
 
how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.how can i use my minded pi coins I need some funds.
how can i use my minded pi coins I need some funds.
 

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