Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Place buy and sell Order

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

    Place buy and sell Order

    I have been trying to place a buy and a sell order just before market opens.

    The 2 issues are the following:

    Only a long or a short will be placed but not both.

    The second issue is when the market opens my order disappears

    I thought I found the issue about managed vs unmanaged but when I set unmanaged to true, my strategy goes to false. Here is the tidbit of code.

    #2
    Hi MyhomesVN, thanks for your note.

    To set an entry order on either side of the market you will need to enable the unmanaged mode. Only SubmitOrderUnmanaged() can be used to submit orders when IsUnmanaged = true; To know why your order is canceled, you can turn on TraceOrders in State.SetDefaults and view the NinjaScript output console when the order is canceled.

    One common reason an order is canceled is because of what the managed approach strategy is doing. Orders will be canceled at the close of every bar and the order needs to be re-submitted. You can use a method override that takes isLiveUntilCanceled

    e.g.
    EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName)
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    11 responses
    38 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    3 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X