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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    59 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    74 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X