Initial Balance Studies -I

QuanTrader
7 min readJan 17, 2019

--

Just jotting down a few Initial Balance(IB) studies for future reference. It all started with a question, whether there is a relationship between what happens in the first hour of the session(IB) and the rest of the session or it’s totally random?

Friendly warning, most are the failed attempts here if used exclusively. However, we can incorporate these findings as an additional condition in our other existing systems.

Studies are based on #Nifty F.(NSE India index future) 396 days of trading history from start date 2017/05/02 to end date 2019/01/11 (except the last study, which I explained there)

Variables I have used: IB high, IB low, IB volume, IB close, Day close, day open, IB volume.

Initial Balance(IB) = Activity in the first hr of the day. For NF 9:15–10:15

Study 1.

IB high is also the day high: 145 out of 396 days.

IB low is also the day low: 142 out of 396 days.

Conclusion: Random.

Now, let’s use rule-based approach (I’ve used Multicharts for studies)

Study 2.

Let’s make some naive rules for our system (pseudo code).

  1. Long: If IBhigh > open by some threshold* and IB close> Open
  2. Short: If IBlow < open by some threshold* and IB close <Open
  3. Square off all at day close.
  4. *Threshold = 25% of last 5 days daily range(average range*0.25). This acts as a crude volatility filter.

eg. Let’s assume last 5 days average range is 100, current day open is 10800 and current IB high is 10861 and IB close is 10840(which is greater than day open). It passes all the conditions as 10861 (IB high) is higher than 10800(open) + 25(volatility filter=100*25)= 10825 so we will go long at 10840 (IB close)

Here are the results for both long and short

Aprox 57% winners for long and aprox 50% winners for short trades. Which means almost random.

Let’s find out if there is a linear relationship with the volatility filter. In other words, we want to check if the probability of trend continuation increases with larger IB highs (and downtrend with lower IB lows.)

Above graph indicates that probability of trend continuation increases with increase in IB high but it stops at 0.60%. Using our previous hypothetical example IB High greater than 60 points from open will slowly result into trend reversal. Note that even with optimal volatility filter of 0.60 winning probability is at max 61% Also, with the increase in the filter the number of trades will greatly reduce and hence our returns on capital diminish unless you trade with large capital which comes with another complication and require more evaluation metrics.

Study 3

We will keep all the above rules with 0.25% volatility filter but add an extra rule.

For long the extra rule is, open is above previous day close and for short open is below previous day close. This is the most simple and naive trend rule, we can do it more complex like some moving average etc but that will increase the risk of curve fitting(more degree of freedom).

Here are the results

We can see a slight increase in % winners but still short trades are almost random. Usually, you can get long trades right by random chance in a bull market. To check strategy robustness I’d like to see how short trades are doing. So overall bit okay performance but not passable.

Study 4

Well, forget IB high and IB low, let’s use simple IB close.

Rules:

  1. Long: If IB close> open by some threshold*
  2. Short: If IB close< open by some threshold*
  3. Square off all at day close.
  4. *Threshold = 0.25% of last 5 days daily range(average range*0.25). This acts as a crude volatility filter

Results

Almost the same % winners as IB high/low and understandably the number of trades are less now as chances of IB high> open are higher than IB close >open. This also means fewer returns.

Study 5

We will check fixed exit when price crosses above IB high +filter.

%winners increased (not surprisingly) as the exit was early, but check average win/loss ratio also reduced which means net returns will be almost identical for both fixed exits and exit at the close.

I have tested a small variation of above fixed exit rule by using exit target as IB high + IB range. Results are even worst so haven’t included here.

Study 6

Last part of the IB study. Instead of predicting the direction lets predict the rest of the session returns in any direction (kind of historical volatility). Here volatility means day close — IB close.

Let's first calculate the rest of the session returns in % term.

return % = 100*(day close — IB close)/day close.

Eg. If IB close is 9200 and Day close is 9300 then 100*(9300–9200)/9200 = 10000/9200=1.09%

Results:( tested on 4000 days of history (precisely from the beginning of 4 Jan 2010 where NSE open time changed from 10:00 to 9:15 am IST)

If IB Volume is > 1.75 times its 30-day average IB volume then the rest of the session returns on average are 0.71% There were 94 such instances.

If 1.75 times IB Volume < its 30-day average IB volume then the rest of the session returns on average are 0.43%. There are 154 such instances.

So the answer is slight yes, we can predict a little bit of volatility if IB volume is high.

This study might sound little meaningless on the surface of it but it gives a few valuable clues. For instance, we can guess what kind of market profile day to expect, if the IB volume is less then we can expect ‘D’ shape profile. If IB volume is high then depend on other parameters we can expect a double distribution or multi-distribution elongated profile. This all helps in position management. If we are expecting multi-distribution elongated profile then it’s better to hold the existing position.

By the way, my Twitter bot @stoictraderB posts IB related tweets but it considers IB = 9:15 to 10:00 AM IST

Now in the second part, we dive into Machine Learning using IB features.

A few suggested using small IB and exit early. Before that, I want to reiterate that my intention here is to find a relation between the 1st hour and the rest of the session so we can use that info in other intraday strategies since we can set a bias for the whole day.

Study 7

Rules where IB = 30 minutes instead of 1 hour:

  1. Long: If IB close> open by some threshold*
  2. Short: If IB close< open by some threshold*
  3. Square off all at day close.
  4. *Threshold = 0.25% of last 5 days daily range(average range*0.25). This acts as a crude volatility filter

Results

Optimization for exits at 1000 am, 1100 am and 1200 am

% profit increased but still, they were around 50% also win-loss ratio decreased as we wait further.

Optimization for different volatility filters ranging from 0.10 to 0.80%

Almost same or little bad as IB 60 minutes. Also tried to re-enter after 1330 (Europe session) when high crosses above IBH but it didn’t improve the results, we can use numerous variations but it will be nothing to do with IB, a system on its own which is out of scope for this post. Thanks, Sandeep Rao for mentioning though, micro IB made me curious.

Study 8

Based on this idea. Also, it’s in line with the underline theme here which is to find a bias for the day using IB

Rules:

Long:

  1. IB high is higher than previous day high
  2. IB close is higher than previous day high
  3. IB close > day open + volatility filter (0.25%)
  4. Exit at close

Results are almost the same as Study 3 understandably so because there we have added a trend rule {day open > prev day close} Number of trades were higher in Study 3 than this one without giving up on % winners. Here, one +ve thing happened though: short trades are more successful than long trades. It indicates robustness(read earlier comment on signals in a bull market).

--

--

QuanTrader

Learner, a full-time trader for 11 years. Currently with prop desk based in Toronto risking my own capital.