Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright and Credits
Python Algorithmic Trading Cookbook
About Packt
Why subscribe?
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Reviews
Handling and Manipulating Date, Time, and Time Series Data
Technical requirements
Creating datetime objects
How to do it…
How it works...
There's more
Creating timedelta objects
How to do it…
How it works...
There's more
Operations on datetime objects
How to do it…
How it works…
There's more
Modifying datetime objects
How to do it…
How it works...
Converting a datetime object to a string
How to do it…
How it works...
Creating a datetime object from a string
How to do it…
How it works...
There's more
The datetime object and time zones
How to do it…
How it works...
There's more
Creating a pandas.DataFrame object
How to do it...
How it works...
There's more
DataFrame manipulation—renaming, rearranging, reversing, and slicing
Getting ready
How to do it…
How it works...
There's more
DataFrame manipulation—applying, sorting, iterating, and concatenating
Getting ready
How to do it…
How it works...
There's more
Converting a DataFrame into other formats
Getting ready
How to do it…
How it works...
Creating a DataFrame from other formats
Getting ready
How to do it…
How it works...
Stock Markets - Primer on Trading
Technical requirements
Setting up Python connectivity with the broker
How to do it…
How it works...
Querying a list of instruments
Getting ready
How to do it…
How it works…
Fetching an instrument
Getting ready
How to do it…
How it works…
Querying a list of exchanges
Getting ready
How to do it…
How it works…
Querying a list of segments
Getting ready
How to do it…
How it works…
Knowing other attributes supported by the broker
How to do it…
How it works…
Placing a simple REGULAR order
Getting ready
How to do it…
How it works…
Placing a simple BRACKET order
Getting ready
How to do it…
How it works…
Placing a simple DELIVERY order
Getting ready
How to do it…
How it works…
Placing a simple INTRADAY order
Getting ready
How to do it…
How it works…
Querying margins and funds
Getting ready
How to do it…
How it works…
Calculating the brokerage charged
How to do it…
How it works…
Calculating the government taxes charged
How to do it…
How it works…
Fetching Financial Data
Technical requirements
Fetching the list of financial instruments
Getting ready
How to do it…
How it works…
Attributes of a financial instrument
Getting ready
How to do it…
How it works…
Expiry of financial instruments
Getting ready
How to do it…
How it works…
Circuit limits of a financial instrument
Getting ready
How to do it…
How it works…
The market depth of a financial instrument
Getting ready
How to do it…
How it works…
The total pending buy quantity of a financial instrument
Getting ready
How to do it…
How it works…
The total pending sell quantity of a financial instrument
Getting ready
How to do it…
How it works…
The total volume traded for the day of a financial instrument
Getting ready
How to do it…
How it works…
The last traded price of a financial instrument
Getting ready
How to do it…
How it works…
The last traded time of a financial instrument
Getting ready
How to do it…
How it works…
The last traded quantity of a financial instrument
Getting ready
How to do it…
How it works…
The recorded open price of the day of a financial instrument
Getting ready
How to do it…
How it works…
The recorded highest price of the day of a financial instrument
Getting ready
How to do it…
How it works…
The recorded lowest price of the day of a financial instrument
Getting ready
How to do it…
How it works…
The recorded close price of the last traded day of a financial instrument
Getting ready
How to do it…
How it works…
Computing Candlesticks and Historical Data
Technical requirements
Fetching historical data using the broker API
Getting ready
How to do it…
How it works…
Fetching historical data using the Japanese (OHLC) candlestick pattern
Getting ready
How to do it…
How it works…
Fetching the Japanese candlestick pattern with variations in candle intervals
Getting ready
How to do it…
How it works…
Fetching historical data using the Line Break candlestick pattern
Getting ready
How to do it…
How it works…
Fetching historical data using the Renko candlestick pattern
Getting ready
How to do it…
How it works…
Fetching historical data using the Heikin-Ashi candlestick pattern
Getting ready
How to do it…
How it works…
Fetching historical data using Quandl
Getting ready
How to do it…
How it works…
Computing and Plotting Technical Indicators
Technical requirements
Trend indicators – simple moving average
Getting started
How to do it…
How it works...
Trend indicators – exponential moving average
Getting started
How to do it…
How it works…
Trend indicators – moving average convergence divergence
Getting started
How to do it…
How it works…
Trend indicators – parabolic stop and reverse
Getting started
How to do it…
How it works…
Momentum indicators – relative strength index
Getting started
How to do it…
How it works…
Momentum indicators – stochastic oscillator
Getting started
How to do it…
How it works…
Volatility indicators – Bollinger Bands
Getting started
How to do it…
How it works…
Volatility indicators – average true range
Getting started
How to do it…
How it works…
Volume indicators – on balance volume
Getting started
How to do it…
How it works…
Volume indicators – volume-weighted average price
Getting started
How to do it…
How it works…
Placing Regular Orders on the Exchange
Technical requirements
Placing a regular market order
Getting ready
How to do it…
How it works…
Placing a regular limit order
Getting ready
How to do it...
How it works...
Placing a regular stoploss-limit order
Getting ready...
How to do it…
How it works…
Placing a regular stoploss-market order
Getting ready
How to do it…
How it works…
Placing Bracket and Cover Orders on the Exchange
Technical requirements
Placing a bracket limit order
Getting ready
How to do it…
How it works…
There's more…
Placing a bracket stoploss-limit order
Getting ready
How to do it…
How it works…
Placing a bracket limit order with trailing stoploss
Getting ready
How to do it…
How it works...
Placing a bracket stoploss-limit order with trailing stoploss
Getting ready
How to do it…
How it works...
Placing a cover market order
Getting ready
How to do it…
How it works...
Placing a cover limit order
Getting ready
How to do it…
How it works...
Algorithmic Trading Strategies - Coding Step by Step
Technical requirements
EMA-Regular-Order strategy – coding the __init__, initialize, name, and versions_supported methods
Getting ready
How to do it…
How it works…
EMA-Regular-Order strategy – coding the strategy_select_instruments_for_entry method
Getting ready
How to do it…
How it works…
EMA-Regular-Order strategy – coding the strategy_enter_position method
Getting ready
How to do it…
How it works…
EMA-Regular-Order strategy – coding the strategy_select_instruments_for_exit method
Getting ready
How to do it…
How it works…
EMA-Regular-Order strategy – coding the strategy_exit_position method
Getting ready
How to do it…
How it works…
EMA-Regular-Order strategy – uploading the strategy on the AlgoBulls trading platform
Getting ready
How to do it…
How it works…
There's more…
MACD-Bracket-Order strategy – coding the __init__, initialize, name, and versions_supported methods
Getting ready
How to do it…
How it works…
MACD-Bracket-Order strategy – coding the strategy_select_instruments_for_entry method
Getting ready
How to do it…
How it works…
MACD-Bracket-Order strategy – coding the strategy_enter_position method
Getting ready
How to do it…
How it works…
MACD-Bracket-Order strategy – coding the strategy_select_instruments_for_exit method
Getting ready
How to do it…
How it works…
MACD-Bracket-Order strategy – coding the strategy_exit_position method
Getting ready
How to do it…
How it works…
MACD-Bracket-Order strategy — uploading the strategy on the AlgoBulls trading platform
Getting ready
How to do it…
How it works…
There's more…
Algorithmic Trading - Backtesting
Technical requirements
EMA-Regular-Order strategy – fetching the strategy
How to do it…
How it works…
EMA-Regular-Order strategy – backtesting the strategy
Getting ready
How to do it…
How it works…
There's more…
EMA-Regular-Order strategy – fetching backtesting logs in real time
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy – fetching a backtesting report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy — fetching a backtesting report – statistics table
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy – fetching a backtesting report – order history
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching the strategy
How to do it…
How it works…
MACD-Bracket-Order strategy – backtesting the strategy
Getting ready
How to do it…
How it works…
There's more…
MACD-Bracket-Order strategy – fetching backtesting logs in real time
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a backtesting report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a backtesting report – statistics table
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a backtesting report – order history
Getting ready
How to do it…
How it works…
There's more...
Algorithmic Trading - Paper Trading
Technical requirements
EMA-Regular-Order strategy – fetching the strategy
How to do it…
How it works…
EMA-Regular-Order strategy – paper trading the strategy
Getting ready
How to do it…
How it works…
There's more…
EMA-Regular-Order strategy – fetching paper trading logs in real time
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy – fetching a paper trading report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy – fetching a paper trading report – statistics table
Getting ready
How to do it…
How it works…
There's more...
EMA-Regular-Order strategy – fetching a paper trading report – order history
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching the strategy
How to do it…
How it works…
MACD-Bracket-Order strategy – paper trading the strategy
Getting ready
How to do it…
How it works…
There's more…
MACD-Bracket-Order strategy – fetching paper trading logs in real time
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a paper trading report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a paper trading report – statistics table
Getting ready
How to do it…
How it works…
There's more...
MACD-Bracket-Order strategy – fetching a paper trading report – order history
Getting ready
How to do it…
How it works…
There's more...
Algorithmic Trading - Real Trading
Technical requirements
EMA–Regular–Order strategy – fetching the strategy
How to do it…
How it works…
EMA–Regular–Order strategy – real trading the strategy
Getting ready
How to do it…
How it works…
There's more…
EMA–Regular–Order strategy – fetching real trading logs in real time
Getting ready
How to do it…
How it works…
There's more...
EMA–Regular–Order strategy – fetching a real trading report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
EMA–Regular–Order strategy – fetching a real trading report – statistics table
Getting ready
How to do it…
How it works…
There's more...
MACD–Bracket–Order strategy – fetching the strategy
How to do it…
How it works…
MACD–Bracket–Order strategy – real trading the strategy
Getting ready
How to do it…
How it works…
There's more…
MACD–Bracket–Order strategy – fetching real trading logs in real time
Getting ready
How to do it…
How it works…
There's more...
MACD–Bracket–Order strategy – fetching a real trading report – profit and loss table
Getting ready
How to do it…
How it works…
There's more...
MACD–Bracket–Order strategy – fetching a real trading report – statistics table
Getting ready
How to do it…
How it works…
There's more...
Appendix I
Setting up your Zerodha account
Opening a Zerodha account online
Logging in to the Zerodha trading platform website
Setting up your Zerodha Developer Options account
Logging in to the Zerodha Developer Options website
Purchasing and enabling the Zerodha Developer Options API
Testing API keys and authorizing the app by firing your first API call
Appendix II
Setting up your AlgoBulls account
Registering on the AlgoBulls platform
Logging in to the AlgoBulls website
Fetching your AlgoBulls Developer Options token
Setting up your AlgoBulls account
Appendix III
Developing and improving strategies
Strategy profitability is subject to seasons
Strategy profitability is subject to its parameter values
Backtesting alone does not ensure strategy profitability
Broker limitations
Staying connected with the community
Be prepared for technology failures during actual trading
Other Books You May Enjoy
Leave a review - let other readers know what you think
← Prev
Back
Next →
← Prev
Back
Next →