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 f.saeidi, Today, 10:19 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by kujista, Today, 06:23 AM
          5 responses
          15 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by traderqz, Yesterday, 09:06 AM
          2 responses
          18 views
          0 likes
          Last Post traderqz  
          Started by traderqz, Today, 12:06 AM
          3 responses
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RideMe, 04-07-2024, 04:54 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X