Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Target limit order execution

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

    Target limit order execution

    Can some please explain to me why this happens or how to change it.
    I have a startegy that has a limit order put in as a target price when the strategy is long. The code is:

    if (Positions[0].MarketPosition == MarketPosition.Long)
    {
    double value = Positions[0].AvgPrice + TARGETticks * TickSize;
    TARGETlimitORDERlong = ExitLongLimit(
    0, false, 1, value, "Exit Long Target Reached", "Enter Long");}

    The strategy is being run CalculateOnBarClose = true;
    The screen shot I'm including is it being run on 15 minute bars on the ZB with Session Template set to <use instrument settings>.

    Why is my execution price so much lower than where the price actually traded?

    This problem does not seem to happen with my stops. If there is a gap down on my long position, it exectues the market order properly far below my stop price.

    Thanks in advance.
    Attached Files

    #2
    8DTK8, did the target execute at the price you submitted it at? Since it gapped up, it will fill at the limit price.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Austin View Post
      8DTK8, did the target execute at the price you submitted it at? Since it gapped up, it will fill at the limit price.
      Thanks Austin.

      How do you get it not to do that?

      Stop orders seem to get a more realistic fill. If I have a stop for 1400 in the ES and the open is 1394, I'm out of luck for 6 points. Strategy Analyzer reflects this. Why isn't the same for a limit order. If I have a limit for 1410 and the price closes below at 1408 and gaps up to 1415, shouldn't I be 5 points "lucky" and get an execution at the opening price of 1415?

      Comment


        #4
        Originally posted by 8DTK8 View Post
        Thanks Austin.

        How do you get it not to do that?

        Stop orders seem to get a more realistic fill. If I have a stop for 1400 in the ES and the open is 1394, I'm out of luck for 6 points. Strategy Analyzer reflects this. Why isn't the same for a limit order. If I have a limit for 1410 and the price closes below at 1408 and gaps up to 1415, shouldn't I be 5 points "lucky" and get an execution at the opening price of 1415?
        Would that we would be so lucky! Nope. The easiest way to remember it, is to drill it into our heads, that we will always get the worst end of the stick.

        Basically once triggered, the order becomes a market order. That is the only reason that sometimes (very rarely), we can get a favorable fill, if the market spikes up through our (long) limit price and immediately spikes down, so we get filled below the entry price by a tick or two.

        Comment


          #5
          8DTK8, the best way to get around this is to use the 24 hour session. Another option would be to backtest with intrabar granularity, and have the secondary series use the 24 hour session. That way, the main data will come from the session you want, and then the executions will come from the session (hopefully) without gaps.
          AustinNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          24 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          120 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          63 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          45 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X