Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Single day trade

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

    Single day trade

    Hi,

    I'm using daily bars.
    How do I create a strategy that only lasts one day?
    As an example, say an OOPS strategy

    Where the day opens below the prior day
    Buy the Open and sell at the close
    OR Buy on stop at yesterdays low and sell on the close.

    In the OnBarUpdate method, I have -
    If (Open[+1]<Low[0])
    EnterLongStop(DefaultQuantity, Low[0]+1, "LE");

    This works and gets me in BUT how do I exit at the close of the day?

    I've tried things like
    ExitShortStop(Close[-1]);
    But they don't work.

    Thanks,
    Neil.

    #2
    Neil, this is unfortunately not possible on daily bars only unless you add an intraday stream of data as outlined here (but this would need custom coding in the NinjaScript editor).

    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by

    Comment


      #3
      Hi Betrand,

      Could this be done using NTs unmanaged order option? I have been trying to toy with the same idea for backtesting only.
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #4
        Unfortunately not mrLogik, you need the added granularity for intrabar timestamps to be able to exit before the close...the daily series would update as the open tick of the next day comes in only...

        Comment


          #5
          Hi Bertrand,

          Thanks for the reply.

          That's what I suspected, but just wanted to be sure I wasn't overlooking something.

          As always, thank you.
          mrlogik
          NinjaTrader Ecosystem Vendor - Purelogik Trading

          Comment

          Latest Posts

          Collapse

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