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 Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    4 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    40 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    19 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X