Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delay in order execution

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Delay in order execution

    Hi,

    I have a strategy that uses 2 series. The first series is a 10-tick series while the second is a 480-minute one (Note: I selected the 10-tick series as an attempt to catch the price movement as fast as possible. If there’s a better way, kindly suggest).

    My buy condition is a straightforward one. Simply the moment current price (high of the first series 10-tick) is higher than the High of the 480-minute candle (second series), take a buy position. So, here’s how I described it in the code:

    else if (State == State.Configure)
    {
    AddDataSeries(FirstSeries);
    AddDataSeries(SecondSeries);
    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1 || BarsInProgress == 2)
    return;
    if (CurrentBars[1] < 2)
    return;
    if (CurrentBars[2] < 2)
    return;

    If (Highs[1][0]>Highs[2][0])
    {
    EnterLong();
    }

    The problem is that the code doesn’t always execute my condition (when the current price is higher than 480 minute high). In so many cases, it does. However, not all the time. There were times when the current price exceeded with 20 ticks difference, and the buy position was not placed!! I intend to make my profit target as 20-ticks

    Is this attributed to the volatility of the market?
    Is this a little problem in the code?
    How can I ensure there’s no delay in placing my order?


    Thanks

    #2
    Hello Abdullah_KSA,

    If the bar type supports TickReplay, using Calculate.OnPriceChange would be a good solution for triggering an action when the price changes.
    TickReplay allows this to work in historical data.



    To understand the behavior, enable TraceOrders and use Print().
    Below is a link to a forum post that demonstrates how to use prints to understand behavior.


    Print the time of the bar with a message that states this condition evaluated as true.

    Is the order being ignored with a message from TraceOrders?

    Is the condition evaluating as true at the time you are expecting?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X