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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    65 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    23 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    26 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    52 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X