Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Order problems

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

    Order problems

    Hi

    Have a strategy that places "working" orders at defined prices on the close of a bar when the conditions are met.

    The system starts the order process of submitted -> accepted but never gets to the working stage. (Previously it was going all the way through to "working" but had a cancel order problem.)

    Then on the very next bar it starts the process of cancelling the order, which it should not do until 4 bars later, based on certain conditions. I have commented out the cancel order method but to no avail.

    I am using the OnOrderUpdate method to manage my orders and using the following
    EnterShortStopLimit(Quantity, entryPrice * TickSize, "selllmt");
    EnterLongStopLimit(Quantity, entryPrice * TickSize, "buylmt");
    to place the orders. They appear as dots on the screen to confirm they are at the correct prices.

    So in essence why do they not become working orders and why do they get cancelled on the next bar?

    If any one can point me in the right direction that would be great.

    Thanks in advance

    #2
    Hello fishbed,

    If you have not submitted the order with liveUntilCancelled as true, and if you are not resubmitting the order when the bar closes, the order will be cancelled when the bar it was submitted on closes.

    EnterLongStopLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, double stopPrice, string signalName)


    For a second order to be submitted, this would depend on the settings for EntriesPerDirection and EntryHandling and whether unique signal names are used.

    If EntriesPerDirection is 1 and EntryHandling is AllEntries the second order will be ignored.
    If EntriesPerDirection is 2 the second order will be placed.
    If EntriesPerDirection is 1 and EntryHandling is UniqueEntries and the two orders have the same signal names the second order will be ignored.
    If EntriesPerDirection is 1 and EntryHandling is UniqueEntries and the two orders have different signal names the second order will be placed.

    EntriesPerDirection - http://ninjatrader.com/support/helpG...rdirection.htm
    EntryHandling - http://ninjatrader.com/support/helpG...ryhandling.htm
    Last edited by NinjaTrader_ChelseaB; 04-27-2017, 07:34 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by BarzTrading, Today, 07:25 AM
    2 responses
    14 views
    1 like
    Last Post BarzTrading  
    Started by devatechnologies, 04-14-2024, 02:58 PM
    3 responses
    19 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by tkaboris, Today, 08:01 AM
    0 responses
    3 views
    0 likes
    Last Post tkaboris  
    Started by EB Worx, 04-04-2023, 02:34 AM
    7 responses
    162 views
    0 likes
    Last Post VFI26
    by VFI26
     
    Started by Mizzouman1, Today, 07:35 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X