In your example candle, the following is noted:
- It is an almost perfect bell-shaped distribution of volume.
- There is a finished auction at each end.
This indicates there are no shenanigans and price hasn’t stalled due to a large L2 order or iceberg. So a simple strategy would be to trade whichever side breaks. In this case price breaks bear, so as soon as that happens, place limit orders between the break point and the previous range high, last rotation high, 50%, or VPOC - whichever is most appropriate.
However, if this candle ended its high with a large buy imbalance rather than a bell-shaped curve, that would indicate price has stalled because of a large passive order or iceberg. This is important to note because once the order is filled, price will tend to surge or pop to the other side due to algos and traders that were treating the large order as protection and front-running it. All of those trades will exit simultaneously when the level breaks.
So this would invoke a different strategy:
- Rather than waiting for price to break above/below the previous rotation/auction to determine direction, we already know which direction to take - away from the blockage, using the blockage as protection.
- Time is of the essence and there is usually competition for this trade; consider a marketable limit order rather than wait for a passive limit order to be filled.
- The opportunity generally doesn’t last long, and this may setup a subsequent strategy that fades the pullback with the expectation of then breaking through the blockage.
If this candle ended with a high distribution of volume at the top (not bell shaped), and that volume showed a strong sell imbalance, that would be unusual and would indicate somebody is looking to enter long wherever they can get liquidity (even at an unfavourable location), or prevent price falling. This can be indicative of a breakout initiation.
In this case, a third strategy may be invoked, which would be to enter for a breakout with an absolute stop just below the point of initiation, or 50%, or VPOC, depending on which is most suitable.
So in summary, imbalances should influence the strategy selected by the algo.
Regarding the code I write, if statistical analysis is involved I will use Python. For realtime execution and strategy I use c++.