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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    308 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    199 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    186 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    275 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    229 views
    0 likes
    Last Post CarlTrading  
    Working...
    X