Bot Primer, Part 2: Market Profile

QuanTrader
4 min readJan 6, 2020

--

In the last part, we have covered various market open types. those who missed, here is a link

In this part, we will cover how to do the objective assessment of the day using Market Profile (MP).

So, what is Market Profile? Well, it is nothing but price distribution on a horizontal scale. Those who are are familiar with probability distribution will get the basic idea.

Here is an annotated Market profile chart for those who are not familiar with the topic, especially the nomenclature.

Okay, so now we know what Market profile or price distribution is. Let’s cover types of price distribution then. In market Profile lingo they often called ‘day types’. Do note that the day types my bot uses are different from those described by J Dalton in his book ‘Mind over Markets’. My approach is a less nuanced one. For instance above distribution is double distribution but my bot will say normal distribution because distribution is even above and below the median. More on it below.

Day types we are going to cover are of 3 types.

  1. D-shape distribution or normal distribution where price distribution is almost equal above and below day’s median value. Even though distribution is normal there will be always some skew. Bot assigns a weight of 1 if the distribution is slightly skewed up (o to 20%) and -1 if the distribution is slightly skewed below the median (0 to -20%)

The formula is something like this [% of price distribution above medium — % of prices distribution below the median ]

  1. p-shape distribution where price trades most of the time above the median (>20%) which is a bullish pattern. Bot assigns a weight of 2.
  2. b-shape distribution where price trades most of the time below the median (<-20%). This is a bearish type of pattern and bot assigns a weight of -2

You must be wondering, why to complicate the life and classify price action using various day types? Well, if you look at those day types mentioned above we have assigned the weight based on overall price distribution and not just based on where the price closed relative to its opening price — often used in classical charting like candlesticks.

Here is a pic from my old Twitter handle which depicts a hypothetical market cycle and how these day types play the part.

Enough about the basics, let’s get back to the original objective of the article, let's decipher the rest of the Market Profile tweet my bot posts.

Here is a sample tweet dated 20200103 (YYYY-MM-DD).

The overall logic behind this particular format is to find

  1. What market achieved — we get that info by calculating net strength, which is the sum of all the weights described below. eg in the above tweet net strength is -33.33%.
  2. Where the price closed- if it is above POC bot assigns a weight of +1 and if it’s below POC bot assigns a weight of -1
  3. How was the price distribution- bearish b-shape, bullish p-shape or normal D-shape? We covered that already.
  4. In the context of the previous day's distribution, how the current day looks like — overlapping, slightly overlapping or isolated up/down?

For instance, in the above tweet VAH < yVAH and VAL < yVAL where y stands for yesterday and both value area high and low are below yesterday’s value area high and low respectively. From this info we get that today’s price distribution is isolated one and it is below previous day’s price distribution which is a bearish type of formation.

5. Where is the current day’s fair price relative to the last 5 days' fair price?

eg. In the above tweet, POC from 5D Avg POC is -28.8

6. Was volume supporting the directional bias? For that, we use cumulative delta.

Cumulative delta = sum of up volume minus down volume. Up volume is the volume when the price closes above the previous close, the reverse is true for down volume.

This concludes the Market Profile part as far as my bot is concerned.

Those who are programmers and interested in technical aspects. The bot uses 1 minute O,H,L,C,V data of Nifty Futures current month with last 6 days IEOD history. Everything runs in the AWS server. Here is an old post along with GitHub fork for calculating value areas.

Those who are discretionary traders and want to explore more on Market profile then have a look at this old Mind Map which explains various Market Profile nuances that you can follow and assess the day objectively.

Thanks for your patience. In the next part, I will cover topics related to Index Options that my bot posts at the end of the day.

--

--

QuanTrader

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