nishant bali - investallign · deviations in price, ... tata motors /nifty :- excel ... w. d. gann...

30
Nishant Bali

Upload: doantuong

Post on 13-Jul-2018

286 views

Category:

Documents


16 download

TRANSCRIPT

Page 1: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Nishant Bali

Page 2: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Pair Trade

Gann Square of Nine

Basic of Options

Basic of Program Algo & High Frequency trading

Page 3: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers
Page 4: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

The pairs trade or pair trading is a market neutral trading strategy enabling traders to profit from virtually any market conditions. Pair Trading is a market neutral strategy is meant to profit regardless of whether equities rise or fall.

Types of Pair trade

Algorithmic pair trading:- These strategies are typically built around models that define the spread based on historical data mining and analysis. The algorithm monitors for deviations in price, automatically buying and selling to capitalize on market inefficiencies

Spread

Calender Cross Mkt Intermarket Correlation

Page 5: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Methods of Pair trading

Statistical or Quantitative

Divergence or mean reverting

Technical PT Fundamental PT

Few more examples :-

Current example :- Metal/Nifty based on that Sell JSW Steel/Buy

NIFTY

Tata motors /Nifty :- Excel

Always tries to Neutralize the Pair trade overtrading may run into

huge loses. Ex Silver-Crude pair

Page 6: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers
Page 7: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

William Delbert Gann, is well-known. Gann was one of the greatest

traders in the early twenty centuries.

The accuracy of W. D. Gann's prediction was up to 85%. Gann

claimed that his every forecast was solely based on mathematical

principles.

W. D. Gann said that the 360 degrees of a circle and the numbers

from 1 to 9 were the origin of mathematics. In a circle, there may

place a square and a triangle.

Page 8: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers
Page 9: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Gann relied heavily on geometrical and numerical relationships.

The Square of 9 is basically a spiral of numbers. The initial value

can be found in the center of the spiral. This value is the increased

by moving in a spiral form.

The numbers that represent a complete turn (0 or 360 degrees) are

4,15,96 , 1/8 of a turn (45 degrees) are 5,17,65 and The numbers

that represent 1 quarter of a turn (90 degrees) are 6,19,69 etc

The numbers that fall on the double lines form what’s known as the

“Cardinal Cross” and the numbers that fall on the single lines

running into the corners of the square, form what’s known as the

“Ordinal Cross” and that numbers act as a significant Support and

Resistance.

Page 10: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Numbers on the grid running down to the bottom left hand corner

on the Square of Nine, you will find they are the square root of odd

numbers E.g. 5x5 = 25.

If you were to look at the numbers running up to the top right hand

corner on the Square of Nine you will find they are the square root

of even numbers e.g. 4x4 = 16

In Square of Nine parlance we say things like 19 is 90 degrees

from15 and we can say that 34 is 360 degrees from 15.

How to calculate a full 360 degree??

The square root of 15 is 3.87. Add two to the square root of 15 and

we get 5.87. Square 5.87 and we get 34.49

Page 11: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Gann Square of "9"

5439.063 5457.516 5476 5494.516 5513.063 5531.641 5550.25 5420.641 5112.25 5130.141 5148.063 5166.016 5184 5568.89

5402.25 5094.391 4935.063 4952.641 4970.25 5202.016 5587.56 5383.891 5076.563 4917.516 4900 4987.891 5220.063 5606.27

5365.563 5058.766 5041 5023.266 5005.563 5238.141 5625

5347.266 5329 5310.766 5292.563 5274.391 5256.25 5643.77 5757.016 5757.016 5738.063 5719.141 5700.25 5681.391 5662.56

Suppose LTP is 5152

Enter current market price 5152

Gann Square of "9"

5587.563 5606.266 5625 5643.766 5662.563 5681.391 5700.25 5568.891 5256.25 5274.391 5292.563 5310.766 5329 5719.14

5550.25 5238.141 5076.563 5094.391 5112.25 5347.266 5738.06 5531.641 5220.063 5058.766 5041 5130.141 5365.563 5757.02

5513.063 5202.016 5184 5166.016 5148.063 5383.891 5776 5494.516 5476 5457.516 5439.063 5420.641 5402.25 5795.02 5909.766 5909.766 5890.563 5871.391 5852.25 5833.141 5814.06

5152 comes between 5166 - 5148 Buy above 5166.01 TGTS 5184 -5220-5256

Sell below 5148.06 TGTS 5130-5112-5094

Page 12: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers
Page 13: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

o Derivative is a product whose value is derived from an Underlying

Assets .

o Instruments in Derivative includes : Commodity Derivative, Currency

Derivative, Interest Rate Derivative .

o Derivatives first came about in Japanese rice markets in 1650’s .

o The first organized derivatives market came in 1848, when the

Chicago Board of Trade ( CBOT)

o Total size of International Derivative Market exceed $109 trillion in

outstanding contracts and over $400 trillion (Bank of International )

.

Page 14: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Number of Stocks and Indices Available for Trading

Stocks

(228)

Indices

(9)

Stocks & Indices

Available

NIFTY

NIFTY MINI

S & P 500

CNXIT

CNX INFRA

BANK NIFTY

Dow Jones

CNX MID CAP 50

CNX PSE

Page 15: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

FII

(57.3 bn; 70 %)

Cash

(INR 177 bn)

Institutional

(83 bn; 47%)

Non Institutional

(94 bn; 53%)

FII

(57.3 bn; 70 %)

MF

(12.2 bn; 15 %) Insurance

(13.6 bn; 15 %)

Derivative

(INR 1180 bn)

Institutional

(255 bn; 21%)

Non Institutional

(925 bn; 78%)

FII

(250 bn; 21 %)

MF

(5 bn; 1 %)

Insurance

(N.A.)

DIIs

Page 16: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Forward is a contract between two entities , where settlement

takes place at specific future date.

Where Future is nothing but a “Standardized Forward contract”.

Futures Forwards

Trade on an organized

exchange

OTC in nature

Standardized contract

terms

Customized contract terms

No chances of Counter

party risk

Chance of a Counter party

risk

Requires margin

payments

No margin payment

Follows daily

settlement

Settlement happens at end of

period

Futures Options

Exchange traded Same as futures

Exchange defines

the product

Same as futures.

Linear payoff Nonlinear payoff

Both long and

short at risk

Only short at risk.

Page 17: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Futures contracts have linear payoffs .

Means both profit and losses are unlimited.

Long Future Short Future

Buy Future Contract : Bullish

Buy @ Rs 100

Sell Future Contract : Bearish

Sell @ Rs 100

Page 18: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

o Option price/premium

o Expiration date

o Strike price

o In-the-money option

o At-the-money option

o Out-of-the-money option

Page 19: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Option contracts have Non -linear payoffs.

Means buyer having an unlimited profit but limited loss

Profit

Loss Long Call

0

-60

Long Put

Profit

Loss

Page 20: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

o In Call option, breakeven point for buyer would be @ Strike price

+ Premium .

o In Put option, breakeven point for buyer would be @ Strike price

- Premium

o Premium = Intrinsic value + Time value.

o Intrinsic value of an option: The option premium can be broken

down into two components - intrinsic value and time value. The

intrinsic value of a call is the amount the option is ITM, if it is

ITM. If the call is OTM, its intrinsic value is zero. Putting it

another way, the intrinsic value of a call is Max[0, (St — K)] which

means the intrinsic value of a call is the greater of 0 or (St — K).

o OTM :- Don't have Intrinsic Value .

Page 21: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Options Call Options Put Options Buyer

(Bullish)

Right to

Buy

No initial

margin

Pays

premium 1 December 2011 Writer

(Bearish)

Obligation

to Sell

Initial margin

to be paid

Receives

premium Workshop on Derivatives

Buyer

(Bearish)

Right to

Sell

No initial

margin

Pays

premium

Writer

(Bullish)

Obligation

to Buy

Options

Call Options Put Options

Buyer

(Bullish)

Writer

(Bearish)

Right to

Buy

No initial

margin

Pays

premium

Obligation

to Sell

Initial margin

to be paid

Receives

premium

Buyer

(Bearish)

Right to

Sell

No initial

margin

Pays

premium

Writer

(Bullish)

Obligation

to Buy

Initial margin

to be paid

Receives

premium

Page 22: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

o The Put/Call Ratio is an indicator that shows put volume relative to

call volume. Put options are used to hedge against market weakness

or bet on a decline. Call options are used to hedge against market

strength or bet on advance. The Put/Call Ratio is above 1 when put

volume exceeds call volume and below 1 when call volume exceeds

put volume.

o But exactly what it is ?? Major Foreign or smart players likes to Short

instead of Buy. Hence a rising P/C ratio is bullish for the market and

vice versa.

o But being a smart traders we would like sail on the other side of the

waves. I.e. Sell the market when the ratio touch 1.30-1.38 and Buy

when it falls till 0.70-0.78

Page 24: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Traders,

We are taking all your queries on writing your script/strategy on algoZ in the blog, “Code your Technical Analysis Strategy”. I have gotten a few queries like, “Once you have written a script, what next?” Though it is explained in the user manual, let me show you below how to take the strategy live, how to run/stop it, how to have a preset stop loss, and more…

In the simple example, we had used a really basic strategy which was on a 14-candle EMA. So, basically, the strategy is “buy” if the price of the stock goes over the 14 EMA and “sell” if it goes under. The problem with a strategy like this is that if you are looking at a 1-minute/5-minute/hourly candle, this crossover will happen quite frequently giving a lot of trades. In the simple example, we had gotten 823 trades over a 22-day period in the backtesting report which is pretty high by any standards.

To explain how to manage your script, I will use another example, the one that has been asked in the tutorial blog by one of you.

Strategy:

The same 14 EMA crossover as mentioned in the example above, but we use RSI as a filter. Typically, RSI below 30 means that it is getting oversold and if above 70 it is getting overbought. So what we want to do is buy/sell on 14 EMA crossover but buy if RSI is below 45 and sell if RSI is above 55.

Here’s the script:

Buy Expression: Close>EMA(Close,14) AND RSI(Close,14)

Sell Expression: Close55

Buy exit : 0

Sell exit: 0

Contract: Nifty Futures.

The script window will look like this:

Page 26: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Backtest Window:

You will see that by having the RSI condition, the total number of trades in the 22-day period has dropped from 823 to 19, but the net profit on backtesting shows only 43 points. See the pic below. Also, if you notice in the backtest report the largest loss making trade was 200 points and this could have been controlled at 50 points by having a SL which would have improved the profitability of this strategy.

Page 27: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Taking it live/Alert Preference: As shown in the first example, when you click on the Live button you get a new window “Alert preference”, which is the menu to preset the Quantity/SL/Type of the order you want to execute when the strategy gives you a signal.

Page 28: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Managing your script once you have taken it live:

In the pic above, once you have clicked on submit, the strategy goes live. To see all

the live scripts/strategies that you are running on your account you can go to the

link shown below:

Page 29: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Once you click on Pulse Running Scripts you will get the window as shown below:

Once you have taken a strategy live, all you have to do now is wait for the

buy/sell alerts to pop up. If you click “Act on Alert” an order is placed based on

your alert preference as shown above.

Happy Coding,

Page 30: Nishant Bali - Investallign · deviations in price, ... Tata motors /Nifty :- Excel ... W. D. Gann said that the 360 degrees of a circle and the numbers

Email id :[email protected]

Ph :# 9537444455/9558035841