Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can you place a stop order on or near the close for the next day's open?

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

    How can you place a stop order on or near the close for the next day's open?

    Hello,

    I am looking for some way to identify, inside my NinjaScript, that I am at the end of the current trading day. I would like to place a stop order at that time, that can be executed, at the earliest, on the open of the following trading day.

    I could possibly check OnBarUpdate() of the 1 Minute Bars and see if Time[0] = ClosingTimeOfTheMarket, then place the stop order for the next day, but the problem is that there may be no trading for the last few minutes, and so Time[0] might never equal ClosingTimeOfTheMarket on a given trading day.

    Also, I can't find any custom NinjaScript events like "OnClose()".

    What are my options for placing a stop order at or near the end of the day, for execution on the next day, at the earliest?

    Thank you very much in advance!

    ChiTrader2000

    #2
    Hello,

    Try using a condition like this:

    if(ToTime(Time[0]) > 140000)

    Set your time for after market hours so that your order is placed on the market open.

    Note: This will only place the trade if there are some after market data. If you receive no after market data then it will not process your logic.
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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