Separate an intrabar breakout from a completed-bar signal

Price may briefly exceed a range and retreat before the bar finishes. For a Sierra Chart ACSIL strategy, a completed-bar filter makes this distinction explicit rather than allowing every intrabar price update to trigger an entry. This example uses a long-only breakout above the highest high of the preceding 20 bars.

Define the signal and timing

Suppose the earlier range high is 100. A signal bar that touches 104 but closes at 99 fails. A bar that reaches 104 and closes at 103 passes. In both cases the reference range excludes the signal bar. A market order can be considered after the signal bar is recognized as closed, not at the earlier intrabar touch.

Completed-Bar Breakout Entries in ACSIL

Hypothetical OHLC comparison: an upper wick above 100 is not enough; only a close above 100 qualifies.

ACSIL entry fragment

// Inside an ACSIL study with sc.AutoLoop = 1.
// After the sc.SetDefaults block:
if (sc.Index < 20)
    return;
if (sc.GetBarHasClosedStatus() != BHCS_BAR_HAS_CLOSED)
    return;

float level = sc.High[sc.Index - 1];
for (int k = 2; k <= 20; ++k)
    if (sc.High[sc.Index - k] > level)
        level = sc.High[sc.Index - k];

bool signal = sc.Close[sc.Index] > level;
if (!signal)
    return;

s_SCPositionData pos;
sc.GetTradePosition(pos);
if (pos.PositionQuantity != 0)
    return;

s_SCNewOrder order;
order.OrderQuantity = 1;
order.OrderType = SCT_ORDERTYPE_MARKET;
int result = sc.BuyEntry(order);
if (result < 0)
    sc.AddMessageToLog(sc.GetTradingErrorTextMessage(result), 0);

Use automatic looping, and configure sc.AllowOnlyOneTradePerBar = 1, sc.AllowMultipleEntriesInSameDirection = 0 and sc.AllowEntryWithWorkingOrders = 0 in the defaults block. Set a suitable maximum position size and start with sc.SendOrdersToTradeService = 0 in simulation. The code is an entry fragment; it requires protective attached orders, an exit policy, explicit order-state checks and trading enable controls before it can become a complete strategy. A return value indicating submission is not confirmation of a fill.

Why the last bar matters

According to Sierra Chart's GetBarHasClosedStatus documentation, the last chart bar is not recognized as closed until another bar is added. That can delay the actionable signal, particularly in quiet markets and variable-duration bars. Do not assume that the fill equals the signal close. Consult the ACSIL automated trading documentation for order management, simulation and skipped order behavior.

Testing and limitations

Compare intrabar and completed-bar variants using the same historical data, commissions and realistic slippage. Track entry delays, false signals, missed trends, drawdown and trade count. Test chart replay at session boundaries, during gaps and with outstanding orders. A confirmed breakout can still fail. The example has not been compiled or backtested here; leveraged trading can result in substantial loss.

For custom bar-close filters and ACSIL order management, see Custom Sierra Chart strategy Development Services.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.