Opening Drive

Discretion to Automation | My Journey So Far | NIFTY OD Strategy

Writing this post to document my challenges as I am trying to automate my trading strategies. As shared in the previous post, I am working on Automating some of my trading strategies, but I am also realizing how difficult it is to convert what was once a Hybrid trading strategy (Quant informed but Discretionary) to a fully Quantitative and Automated strategy.

The Good

  1. Given almost a decade long screen time, it really helps you come up with hypothesis-es which form the basis for your trades and rules.

  2. So in a way, as they say in the world of Optimization, you can define your “Optimization Space” better.

  3. Automation efforts can have a fairly non linear pay off, your effort is towards a strategy, which is sort of fixed, but can be deployed for multiple people and allocation sizes (regulation permitting).

  4. You get more time to focus on Strategy Design than on Execution.

The Bad

  1. Its not easy to deal with itchy fingers, reminds me of the Ulysses and the Sirens story , I need someone to tie my hands for now. You invariable want to ‘finger’ the trade.

  2. Its impossible to factor in that “hunch”, where you square off saying - I don’t think this is going anywhere.

  3. Lower Returns - Yes, its quite possible that the returns from the same strategy may reduce due to its inability to factor in all the variables which you as a human would. I am not sure about this, will update as and when I get to know.

The Ugly

  1. Thankfully no Ugly situations so far. Lets see. Fingers Crossed.

Which Strategy is being Automated?

I am testing my Bread and Butter Strategy that I call NIFTY - OD this strategy tries to capture a part of the Opening Range of NIFTY Futures. At the moment this is being implemented and tested on Futures, later will move it to Options for better cost efficiency.

NIFTY - Scalping Set-up - 01 - Opening Spikes & Opening Drive

Context - As a Scalper / Day trader, mornings are very important for me. Some of you would have noticed in the room that my position sizing in the morning is at max, the reason for that is simple - The probability of range extension + linear price moves (Opening Drive) is more in the morning than in the afternoon.

Now lets delve into the specifics of a setup. Remember the moment we use the word setup you need to be sure of the following elements before hand

1. What determines entry?

2. What is the probable - max favorable excursion - reward?

3. What is the probable - max adverse excursion - risk?

4. Trade Management Approach? Is it 

a) Fixed Size Buy - Scale Out

b) Fixed Size Buy - Fixed Size Sell - All in / All out

c) Scale in - Scale Out

d) Scale in - Fixed Size Sell/All out

While we would visit each of the above issues by themselves, we will now see how visually how does the opening spikes look like and is it worth trading them? 

Look at the image below, it's a NIFTY slight ITM Strike - These are two days of Opening Spikes

Fig -1 Opening Spikes

Do you see a trading opportunity here? Scalpers typically would do their "Johnny One Lot" as Tom Sosnoff calls it here. Knowing very well that the direction of the spike may or may not be the Opening Drive. If you can afford to loose no harm in warming up with a lot or two here. Typically this Occurs between 9:16 to 9:30 IST

Next comes the main Opening Drive trade which is where we expect around 50 to 60% of the day's range to form. The high of this Opening Spike or the Day High till that time becomes an important reference for a breakout trade for the Opening Drive. Typically this occurs between 9:30 to 11:30 - Read it as 1 hour of up move + 15 mins of consolidation at top / retests of high + 45 mins of Mean reversion. The below pictured represent the above two days and their Opening Drives.

Coming to the specifics of the setup

1. Entry Criteria

You define the candle closing time, for entry, you can define anytime, like close of 9:16 candle? - esp. if you want to trade the Opening Spikes. For Opening Drive its better to wait for 10 to 15 minutes at least. So the entry for Opening Drive would be the high after 15 or 20 minutes, you can define it or take it based on momentum at that time. Whatever approach you choose, understand that this is a breakout trade and its safer to enter a bit higher instead of lower, a bit higher would mean 1 or 2 points on NF.  

Fig2.jpg
Fig3.jpg

Since this is still the open, the probability of a range extending is fairly high. (In this para I am talking from a Options Long perspective, it can be CE or PE)

Also look for any previous day's price levels which can act as support/resistances.The following are the key - Previous Day  High/Low/Close/VWAP - If you are keen you may also want to mark similar levels for the previous week - High/Low/Close/VWAP. (In this paragraph I am referring to NF Nifty Futures)

The reason its important to keep these levels as a reference, is because larger time frame traders would use these levels as references (for Buy or Stop Loss) and that may create a flush/volume spike.  

2. What is the Reward - Max Favorable Excursion?

Now that we have defined the entry criteria, the next thing we would need to know is, what is the best and worst that can happen. Lets start with the best things first. Here I would borrow John Sweeney's concept of MFE (Maximum Favorable Excursion) which mean's if the trade works in our favor what is the max gains that we can expect from it. To understand that let me take you through some back-tests that we have done.

The first / second images tell us - what to expect if the price crosses the day high or day low formed till 9:17  on Nifty Futures?

Price crosses Day High till 09:17 

Price crosses Day High till 09:17 

Since we are direction agnostic, lets see what happens when the price crosses the Day Low till 9:17 

Price crosses Day low till 9:17

Price crosses Day low till 9:17

The above data tells us what is it that we can target, obviously if you are using options as a trading instrument you would need to factor in delta of the strikes which you are trading. Nevertheless, we now how a probabilistic sense of what to expect. 

The above information is relevant more for trading Opening Spikes. In the next update to this post, I will share the MFE for Opening Drive.

When thinking about Opening Drive we need to keep three factors in mind to understand the market structure at that point in time.

1. Define a reference - In our case we will use the mean or ATP or VWAP as a reference.

2. We need to understand the mean excursion from the ATP/VWAP- Look at the chart below. Which gives us an important data point - 

This chart tells us the mean percentage of the intra day range that gets formed before 1:30am . As you can see it says 60%, if for e.g. the intra day mean (high-low) range for the index for a given period of time is 70. 60% of 70 i.e. 42 is what gets formed before 1:30pm. 

3. The next aspect that we need to determine is, how does the 42 points range gets formed (between 9:00am to 1:30am).

In the chart below, what we see is, it takes about 83.4 minutes (apox. 1.5 hrs) from 9:15am to the point of Max excursion (high or low) during the first half .

So we have 3 references to work with, a) We know the mean/ATP/VWAP at a given point of time, b) We know the mean (H-L) range that gets formed in the first half 42/25 ish. c) We know that it happens in about 1.5 hours. Creating probabilistic frameworks like this is the key to scalping, its helps us understand where we are at a given point of time and how the odds of wins stack for or against us. 

Feel free to comment and ask questions in the room. Would be happy to clarify.