Project overview
The project combines two custom Sierra Chart studies: a real-time trapped volume detector and an orderblock-based **auto trading system** built on orderblocks. The studies use volume-at-price data to identify stacked bid/ask imbalances, mark areas where aggressive traders are trapped, and automatically generate and manage trades around those structures.
Trapped volume engine
- Reads Sierra Chart’s volume-at-price data per price level with
MaintainVolumeAtPriceData=1. - Computes bid/ask imbalance ratios using configurable thresholds for NY and Asia sessions.
- Identifies “stacked” imbalances over multiple price levels and flags likely trapped buyers/sellers.
- Draws real-time overlays and subgraph markers to visualize trapped zones on the footprint chart.
Orderblock scalper strategy (auto trading)
- Wraps the trapped volume signals into an ACSIL auto trading strategy that runs tick-by-tick.
- Configurable momentum / reversal candle filters, minimum volume, and imbalance position within the bar.
- Places entries around detected orderblocks, with separate enable flags for long/short sides.
- Uses Sierra’s trading APIs for real-time order routing, position tracking, and PnL-aware exits.
Representative code excerpts
Two small snippets from the C++ ACSIL implementation illustrate how trapped imbalances are detected and turned into automated orders. The full code lives in the private Sierra Chart study DLL.
Configuring imbalance thresholds and VAP access
sc.GraphName = "Scalper OrderBlock";
sc.GraphRegion = 0;
sc.AutoLoop = 0;
sc.MaintainVolumeAtPriceData = 1;
Input_BasicThreshold_NY.Name = "NY Basic Ratio Threshold";
Input_BasicThreshold_NY.SetFloat(3.0f);
Input_LargeThreshold_NY.Name = "NY Large Ratio Threshold";
Input_LargeThreshold_NY.SetFloat(6.0f);
Input_BasicThreshold_Asia.Name = "Asia Basic Ratio Threshold";
Input_BasicThreshold_Asia.SetFloat(2.0f);
Input_LargeThreshold_Asia.Name = "Asia Large Ratio Threshold";
Input_LargeThreshold_Asia.SetFloat(4.0f);
The study enables MaintainVolumeAtPriceData and exposes per-session imbalance thresholds so
the same logic can adapt to different liquidity environments (New York vs. Asia).
Turning trapped volume into strategy signals
for (int barIndex = sc.UpdateStartIndex; barIndex < sc.ArraySize; ++barIndex)
{
// Iterate price levels for this bar
for (int level = 0; level < vp.Count; ++level)
{
float bid = vp[level].BidVolume;
float ask = vp[level].AskVolume;
float ratio = (bid > 0.0f) ? ask / bid : 0.0f;
if (ratio > LargeThreshold && vp[level].TotalVolume >= MinVolume)
{
// mark trapped sellers and feed signal into auto strategy
sell_trapped[barIndex] = sc.High[barIndex];
SignalShort(barIndex, level);
}
}
}
The trapped volume engine walks the volume-at-price structure for each bar, identifies stacked ask/bid imbalances that exceed configured thresholds, and marks them via subgraphs and strategy callbacks that manage entries/exits automatically.