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 DJ888, Today, 10:57 PM
    0 responses
    5 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X