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 samish18, 04-17-2024, 08:57 AM
    16 responses
    55 views
    0 likes
    Last Post samish18  
    Started by arvidvanstaey, Today, 02:19 PM
    3 responses
    9 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    8 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    47 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X