Orderflow
VPIN
A study you add to a chart. Ready-made charts are in the chartbook shop.
Description
This study is based on a paper about VPIN which was introduced by Easley, Lopez de Prado, and O'Hara. It estimates how one-sided recent volume is by grouping trades into equal-volume buckets and splitting each bar from its price change. The result runs from 0 to 1.
Key Notes
- One-minute bars are the usual setting.
- The line is a regime gauge. It moves in waves and stays blank until the sample of buckets has filled.
- Caution 0.3023 and Extreme 0.50 are E-mini levels from the 2012 paper, measured at 50 buckets a day. With the faster defaults the line sits higher and crosses 0.30 more often.
- Either reference line can be hidden from its subgraph settings. Both stay in this study's chart region.
Important Inputs
| Input | What it does |
|---|---|
| Volume Bucket Size | The volume in each bucket. It starts at 0. The range is 0 to 1000000000. 0 sets the bucket from average daily volume divided by Buckets Per Day, using up to 20 completed sessions, and refreshes that size when a new session starts. A positive number is used directly. |
| Buckets Per Day | How many buckets that automatic size is split into. It starts at 200. The range is 1 to 100000. It is used only when Volume Bucket Size is 0. 200 finishes a bucket several times an hour on a liquid future. 50 is the daily target from the VPIN paper and runs smoother and lower. |
| Sample Length | How many finished buckets are averaged into VPIN. It starts at 30. The range is 1 to 5000. 30 is a short session window. 50 is one day of volume when Buckets Per Day is 50. |
| Sigma Lookback | How many earlier bars set the standard deviation of close-to-close price changes. It starts at 50. The range is 2 to 5000. The bar being classified is left out. 100 is a wider alternative to 50. |
| Maximum Bars To Process | The most bars a full calculation reads. It starts at 20000. The range is 100 to 1000000. Bars that close after that are appended. |