Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with stop order on the end of session

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

    Problem with stop order on the end of session

    Hello,

    I have problem.

    I create stop order on the 4:15pm and stop order is immediatelly created.
    Not on the after bar by session. Immediatelly.

    But I want to create this order on the 9:30am next day.
    I have defined session in NinjaTrader from 9:30am to 4:15pm and I use it.

    Code:
    protected override void OnBarUpdate()
    {
        ...
        ...
        if (ToTime(Time[0]) == 161500)
        {
            SubmitOrder(1, OrderAction.Buy, OrderType.Stop, 1, 0, LongBreakout, GetOrderName("LongOCO"), GetOrderName("Long"));
        }
        ...
        ...
    }
    Detailed info is in the picture too (in attachment).

    Petr
    Attached Files

    #2
    Hello Petr,

    Thank you for your post.

    Using the FirstBarOfSession property in NinjaScript you can place this order on the opening bar of the session. Currently you are placing the order on the closing bar.

    For information on FirstBarOfSession please visit the following link: http://www.ninjatrader.com/support/h...rofsession.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    117 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    417 views
    0 likes
    Last Post CaptainJack  
    Working...
    X