• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Sh00tHerMcGavin, Today, 07:39 PM
    0 responses
    1 view
    0 likes
    Last Post Sh00tHerMcGavin  
    Started by Mberg, Today, 05:13 PM
    0 responses
    0 views
    0 likes
    Last Post Mberg
    by Mberg
     
    Started by Barry Milan, Today, 01:33 PM
    2 responses
    8 views
    0 likes
    Last Post marcus2300  
    Started by NW Trader, Today, 03:42 PM
    2 responses
    7 views
    0 likes
    Last Post NW Trader  
    Started by ralett, Today, 01:42 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X