Professional Documents
Culture Documents
Table of Contents
Page 06 | Alphas for Algo Trading
Page 14 | Machine Learning for Trading
Page 28 | Coding Cases
Page 33 | Quantitative Trading in Crypto Currencies
Page 44 | Upcoming Conferences in Mumbai/Delhi
A good ATS Execution Strategy saves time spent in sending manually orders- punching and modifying. Similarly, a ATS
signal generation strategy saves valuable time spent in analyzing a stock. Therefore, by saving time in repetitive tasks
though ATS, a trader can focus on managing strategies. Having an ATS is like hiring an assistant for repetitive tasks.
2. Save Money
For active traders, an ATS can save lakhs of rupees spent in slippage. Reducing the trading costs is considered most
important benefits of algo trading. Let us explain it with an example:
Assume you decide to buy Nifty Futures based on momentum and look at its order book. The Best Buyer|Best Seller are
at 8520.20|8520.50
To manually punch order, you press F1, fill limit at 8520.50, click on Send and then click on Confirm.
By the time the limit order goes to exchange, prices move further up- 8520.50|8520.70. Your order is now pending in
exchange as Best Buyer
Since it is momentum based trade, Nifty does not fill your order and moves further upto 8520.80|8521.00
Realizing that your pending order has minimal chances of getting filled, you frantically move on. Go to pending orders
window, Cancel pending order, Press F1, fill limit price at 8521.00, click on Send and then click on Confirm.
By the time the limit order goes to exchange, prices move further up- 8521.20|8521.50. Your order is once again
pending in exchange as Best Buyer.
You frantically repeat the process of cancelling pending order and sending fresh buy order at 8522.00 and get filled.
In such manual trading, you first decided to buy when Best Seller was at 8520.50 but actually bought at 8522.00. This
difference of Rs 1.50 is called as slippage. However, if you had a very fast computer (server) on your side to
automatically send orders, you could have bought near 8520.50, say 8520.60. Thus the ATS can save Rs. 1.40 per trade
per lot. For a intraday trader who makes two trades daily with 3 lots of Nifty, it will amount to monthly saving of Rs.
1.40 *50* 3*2*22= Rs. 9240!!
3. Minimize Emotions
Emotions tend to be the biggest enemy of a trader. When a trader’s intelligence is disturbed by impulsive mind, he may
risk too much on a strategy or abandon a strategy without proper performance measurement.
Since ATS executes pre-defined trading logic, no human emotions are involved. This is considered the second most
important benefits of algo trading.
4. Inculcate Discipline
Discipline once developed can be maintained even when markets are highly volatile or when prices are stagnant for
days. An ATS forces a trader to think systematically by executing trades on well-defined trading logic. It minimizes
emotional impulses.
5. Intellectual Engagement
This is perhaps the best advantage of ATS. Since ATS forces systematic trading, it pushes the traders to continuously
research for better strategies. It engages there intellect to the fullest by calculating risks, costs along with the rewards
of each strategy. Hence it improves the productivity of a trader as person.
Every active trader loses money to menial errors like punching wrong order quantity, wrong order price or sending the
order in wrong scrip. ATS minimizes such errors.
Indians love to gamble a lot- which cricket team will win match or which politician will win elections. By intellectual
engagement ATS also limits gambling tendency.
8. Diversify Trading
Having ATS as assistant saves time to allow you diversifying in more scrips, multiple strategies and multiple segments
9. Complex Strategies
Execute complex strategies which include auto-modifcation, multi-leg, multi-client, multi-scrip and multi-exchange
execution. Therefore, for institutional trading and fund managers, ATS is unavoidable.
Impressed by the benefits of algo trading? Let’s look at its costs. The simplest form of algo trading- a bracket order is
provided free by many brokers. The cost of deploying an ATS depends upon the complexity of decision making and
execution logic.
Coding Cases
By Saurabh Lohiya, Founder AlgoJi
Sell= Cross(Kijun_sen,Tankan_sen);
1. Define Buy and Sell conditions using Foreign() to access all data of Futures & Options
2. Generate Buy/Sell based on condition whether current symbol is the correct future/option
Consider you are optimizing a moving average crossover strategy. You have two moving averages whose
periods ranges from 1 to 100, which you want to optimize.
That's 10000 combinations – means you need 10K backtests to complete the optimization. Even if it takes 10
milliseconds to compete a single backtest, it will take 100 seconds – that’s one hand a half minute- to complete
the optimization.
Now, suppose you decide to add a SL to the strategy, so that there is limit on the max loss you will take per
trade. Assume you want to optimize the SL from 10-50 points with step interval of 0.5 points. So, it will add
40*2 = 80 combinations.
Also assume you add a profit target to the MA strategy. You may like to optimize the target from 20-100 points
with step interval of 0.5 points. This adds 80*20= 160 combinations.
This brings us to 100*160*80= 1,280,000 seconds or aprox 15 days to complete the optimization!!!
1. Start with initial guess of optimal parameters, and the step size
2. Generate first set of offspring from the initial mean
3. Evaluate the offspring and rank it by fitness
def ForecastColor(self,range_lo,range_hi,macd,rsi,candlecolor):
size = 10000
X = numpy.matrix([list(range_lo[-size:-4]), list(range_hi[-size:-4]), list(macd[-size:-
4]), list(rsi[-size:-4]) ]).T
y = numpy.array(list(candlecolor[-size:-4]))
classif = sklearn.svm.SVC(C=100.0)
classif.fit(X,y)
predicted = classif.predict(numpy.matrix([range_lo[-7:], range_hi[-7:], macd[-7:], rsi[-
7:]]).T)
return predicted
Features
No central body to create units
Miners get rewarded in the native currency for verifying the blocks
Categorization of Cryptocurrencies
Altcoins
Derived from the Bitcoins Open Source Protocol
Tokens
Representation of a particular asset/utility that usually resides on top of another blockchain.
SALT, Blocktix
The functionality of creating tokens is made possible through the use of SMART CONTRACTS
Tokens are distributed to the public through an ICO ( Initial Coin Offering )
ICO vs IPO
Types of Tokens
Utility Tokens / Network Access Tokens
Invest in ICOs
Sentiment Analysis
Machine Learning
Buy LTC on BITTREX with USDT and SELL LTC which you already hold on BINANCE
Counterparty Risk
Execution Risk
Low execution speeds resulting in the price being taken by some other trader.
Risks associated with moving the coins from one exchange to the other.
In BEAR markets arbitrage profits will not be enough to offset the decline in the asset price.
Regulatory Risk
Total of 7 coins
On the rebalancing day compute the rank and go long on the top ranked coins and short on the bottom ranked
coins
Asset Classes
Strategies
Styles
Exchanges
Allocate Conservatively
Allocate to Cryptos only What you can afford to lose
Thank You!
Upcoming Conferences
PS: It is hard to call them “conference” because they include online courses, hands-on training
sessions and so many other things 😊
Delhi Algo Traders Conference – 4th August 2018 (details to be announced soon)