Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

difference between EnterLong and EnterLongLimit?

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

    difference between EnterLong and EnterLongLimit?

    Hi Guys,

    The help guide about EngerLong doesn't describe what order price EnterLong is based on. I assume that it is market order. Backtesting, I found the price of EnterLong is equal to Close[0].

    But when an OnBarUpdate is triggered, actually the first tick of next bar has already been created. right? At that moment, what does Close[0] mean?
    Particularly, how much is the Close[0] if Close[0] is in the EngerLongLimit command?

    I am wondering what is the difference in order price between EnterLong and EnterLongLimit?

    Are the following two equal to each other?
    EnterLong(1);
    EnterLongLimit(0, true, 1 , Close[0], "Long");

    If we set CalculateOnBarClose = true; when the EngerLongLimit in OnBarUpdate() triggers, is the Close[0] actually equal to currentbar's close price or
    the open price of next bar?
    Last edited by microsat; 10-29-2015, 02:04 PM.

    #2
    Hello,
    Thank you for your post.
    EnterLong will submit a market order. EnterLongLimit would submit a a limit order.
    The example that you provide are similar and could potentially have the same fill. However, since EnterLong submits a market order there is a high chance you would not get filled at the same price as the limit order. EnterPrice is not a native NinjaScript Method. Is this a user based method you or someone else has created?

    If you submit the EnterLongLimit at Close[0] with CalculateOnBarClose set to true it would place it at the clsoe[0] of the currentBar's close price. It is common to see this equal to the Value of the next bar's Open price, however this is not always the case due to the nature of the markets.

    For more information on EnterLong and EnterLongLimit please see the following link, http://ninjatrader.com/support/helpG...d_approach.htm
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thank you. Further blacktest shows that market orders sent out using EnterLong or EnterShort are filled with the Close[0] price.

      But if you use EnterLongLimit() or EnterShortLimit() with Close[0], you will find that many limit orders will not be filled.

      Does this mean market orders' blacktesting in Ninjatrader is not reliable?

      Originally posted by NinjaTrader_CodyB View Post
      Hello,
      Thank you for your post.
      EnterLong will submit a market order. EnterLongLimit would submit a a limit order.
      The example that you provide are similar and could potentially have the same fill. However, since EnterLong submits a market order there is a high chance you would not get filled at the same price as the limit order. EnterPrice is not a native NinjaScript Method. Is this a user based method you or someone else has created?

      If you submit the EnterLongLimit at Close[0] with CalculateOnBarClose set to true it would place it at the clsoe[0] of the currentBar's close price. It is common to see this equal to the Value of the next bar's Open price, however this is not always the case due to the nature of the markets.

      For more information on EnterLong and EnterLongLimit please see the following link, http://ninjatrader.com/support/helpG...d_approach.htm

      Comment


        #4
        Hello,
        With Backtesting the backtest fills are based of the OHLC values and do not have intrabar granularity so it would be expected all your Limit orders and Market orders would fill at the Close[0]. There is a way to add in intrabar granularity through custom programming. Please see the following link on our reference for Backtesting NinjaScript Strategies with an intrabar granularity
        If we can be of any other assistance please let us know.
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X