Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 03:28:50 +0000



Fill happening at a price not touched by ticks before

View Count: 432

[2020-11-08 21:53:43]
PanCSI - Posts: 9
Hi.

I have a strategy that does certain actions above max and below min for the session.

The code starts like this:

for (int Index = StartingIndex; Index < TimeSalesArray.Size(); ++Index)
  {
    s_TimeAndSales Record = TimeSalesArray[Index];
    Record *= sc.RealTimePriceMultiplier;


    // Do not process already processed sequence numbers.
    if (Record.Sequence <= r_LastTimeAndSalesRecordSequence) {
      continue;
    }
    
    sc.AddMessageToLog("Processing messages", 0);

    updateMaxMinRangeForSession(sc, Record.Price);


Below this code I have some logic that should only happen below the session min price, which is being stored and printed out to the message log.

I see a situation, when backtesting, where the message log prints the price moving down until 3300.50 in the ES.

The following situation prints a message about an order being filled, once again further down the code, with fillprice being 3299.75.

I am not sure if this is because I am in Backtest, or if this is intended behaviour and fill messages are sometimes received before tick prices if there is a gap in the order book.

This is a stop limit order, and I am trying to understand how the price can "skip" 3 ticks, fill my order, but never have a tick with the expected price.

Am I checking the min and max value of the session agains the wrong variable?

How does the matching engine in Sierra's backtests work? Does it fill the stop orders in a way that they can be filled beyond the price that was touched by a tick? Or does it just fill orders if their price is surpassed? Or does it have a finer grained algorithm that processes place in queue?
[2020-11-09 11:28:31]
Sierra Chart Engineering - Posts: 104368
Refer to:
Trade Simulation: How Orders are Filled
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account