mBA-Terminal / README.md
algorembrant's picture
Upload 29 files
c99df4c verified
# What Happens if We Increase or Decrease the Bin Size of Market Profiles (TPO & Volume)?
This applies specifically to the standard or free-tier market profiles available on most charting platforms. Market profiles are typically built on either the **Time Price Opportunity (TPO)** profile or the **Volume Profile (VP)**, whether real or tick-based. Regardless of the type, the underlying calculation is the same: raw data is cleaned through dataframes (xlsx, csv, etc.) and represented through graphs (lines, bars, plots, etc.). A market profile is simply datapoints collapsed into a y-axis distribution, forming a "profile." That is it -- nothing more.
But what actually happens when we increase or decrease the **bin size** (the price-step) of the market profile?
<br><br>
## Collapsing Price Action into a Profile
<table>
<tr>
<td align="center">
<img width="995" height="488" alt="Collapsing price action into a market profile" src="https://github.com/user-attachments/assets/30f8a35e-1060-48c2-8f63-bbda3b989c93" />
</td>
</tr>
</table>
In the figure above, we have one MP chart (left) and one line chart (right), both derived from the same dataset. The price action over time (line chart) moves from point **A** to **B**, **C**, and **D**. When we collapse those datapoints (A through D) into a y-axis distribution histogram, a Market Profile chart is formed.
If we use a bin size of **1.000** and the price range spans **3000.000 to 3010.000**, then between those prices we get **10 bins** worth of grouping. Same data, different representation.
<br><br>
## Larger Datasets and Stacking
<table>
<tr>
<td align="center">
<img width="996" height="488" alt="Larger dataset forming a market profile" src="https://github.com/user-attachments/assets/f05cdd33-80a0-47e1-8041-56543ef5d7d5" />
</td>
</tr>
</table>
With larger datasets, the principle remains the same. Datapoints collapse and stack to form a y-distribution. The more stacking occurs, the larger the profile becomes. In this example, the lowest profile value is **0** and the largest profile value is **4 stacks**.
<br><br>
## The Effect of Changing Bin Size
<table>
<tr>
<td align="center">
<img width="995" height="484" alt="Market profile with different bin size" src="https://github.com/user-attachments/assets/6637ea25-0abc-40ad-a8a1-b35d2abd89cb" />
</td>
</tr>
</table>
The figure above uses the **same dataset** as the previous one, yet the profile looks different. It now has a lowest value of **0** and a largest value of only **2 stacks**. If you are a beginner, this might feel suspicious when experimenting on your preferred charting platform -- but it is completely normal.
The reason is straightforward: **more bins means more price groups for the datapoints to distribute across.** As bin size decreases (more granular bins), each datapoint lands in a more specific price bucket. This spreads the data across more bins, resulting in shorter stacks and a flatter profile. Conversely, increasing the bin size consolidates datapoints into fewer groups, producing taller stacks and a more concentrated profile.
That is the kind of market profile you typically get on free-tier charting and trading platforms.
<br><br>
## An Alternative Approach: Trail-Price Clustering
There is another way to model a market profile. Without going into full detail -- if you are an algorithmic trader or software developer familiar with feature engineering, this will be straightforward. The core idea is to **add data to your original dataframes by clustering trail-prices** (an original concept) to produce a more complete set of datapoints.
<table>
<tr>
<td align="center">
<img width="1006" height="490" alt="Trail-price clustering concept" src="https://github.com/user-attachments/assets/8277ff21-9999-4ac1-b9db-e7c8b99578a3" />
</td>
</tr>
</table>
This concept extends well beyond these illustrations. You can fill in missing data in dataframes (for any dataset) by applying a custom formula using your preferred programming language.
<br><br>
<table>
<tr>
<td align="center">
<img width="1066" height="519" alt="Enhanced market profile model" src="https://github.com/user-attachments/assets/e2bcdea8-1944-4c4f-a467-1d8943972512" />
</td>
</tr>
</table>
The drawings may be rough, but the point stands. In our case, we model a market profile not based on **TOCHL** (Time, Open, Close, High, Low) or **Volume** (real, tick) but on **mBA** (microsecond raw bid/ask) formation.
<br><br>
## Reference
```bibtex
@misc{continualquasars2026blog1,
title = {What Happens if We Increase or Decrease the Bin Size of Market Profiles (TPO \& Volume)?},
author = {ContinualQuasars},
year = {2026},
url = {https://github.com/ContinualQuasars/BLOG-1},
note = {What Happens if We Increase or Decrease the Bin Size of Market Profiles (TPO \& Volume)?}
}
```