Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy on Close (Today)

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

    #16
    This would be expected in backtesting capstonetrader, after your exit triggers then next possible trade location is the open of the next bar, this is NT's conservative approach here.

    Comment


      #17
      Originally posted by capstonetrader View Post
      Thanks, the best I could do in the Ninja Script was:
      If (ToTime(Time[0]) == 1200 && Close[0]>=0)
      {
      ExitShort("exit signal name", "entry signal name");
      }

      It would not let me compile if I just state:

      Then ExitShort This Bar on Close;

      after the Time and Close >= 0 condition.

      So with the Ninja script above, it still exits at the open of the next bar instead of the close of the current bar.
      Intraday, for most cases, there is no difference between the close of one bar and the open of the next. However, if this must be coded as you seem to want, then your only real choice is to calculate the time the bar will close, and exit at that time. On a fixed time frame chart, you know the time the last bar closed (Close[1]), so you merely need to add the time for your chart period to that time, and set the exit based on that time.

      Comment


        #18
        Q

        Originally posted by NinjaTrader_Bertrand View Post
        This would be expected in backtesting capstonetrader, after your exit triggers then next possible trade location is the open of the next bar, this is NT's conservative approach here.
        Bertrand when you say "this is nt's conservative approach" are you suggesting this because although it occurs, the close of one bar and the open of another are not always equal and in real time / real life....If a close is gone, its in the past and the price cannot be accessed by a limit order or such if the price has moved against you by the open of the next bar?

        Meaning its more realistic....

        Comment


          #19
          Correct conservative in the sense of more realism, as when you're detecting a bar close in an event based framework you're essentially seeing it earliest at the open of the next bar, thus offering a fill on the close of the bar before is not adequate we felt.

          Comment


            #20
            You can always use ExitLongLimit() with a limit price at the Close[0]. Of course, that would then be subject to the problem with all limit orders, and how they get filled.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 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
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X