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

OrderManagement quantity doesn't change.

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

    OrderManagement quantity doesn't change.

    In OnBarUpdate method when certain conditions occur, I want to short. So, I do -

    SetStopLoss("ShortEntry", CalculationMode.Price, stop, false);
    SetProfitTarget("ShortEntry", CalculationMode.Price, profit);
    EnterShortStopMarket(quantity, entry, "ShortEntry");

    When the OnBarUpdate called next time after next bar is complete, if the entry didn't happen, I cancel the ShortEntry as -

    CancelOrder(entryOrder);

    The entryOrder is picked up from OnOrderUpdate for "ShortEntry" order name.

    After I cancel the order. I recalculate new entry, stop, profit target, quantity etc and
    resubmit above three orders with new calculated values.

    The new order has everything correct except quantity. The quantity value doesn't change. Am I doing something wrong?

    I print the whole order in OnOrderUpdate and I see the all variables like entry, stop, profit target etc are changed but the quantity doesn't. The quantity is same as the first order and not the newly computed one.

    Can someone help me with this?

    Thank you for your help!
    Last edited by hemanty; 11-07-2017, 08:51 PM.

    #2
    Hello Hemanty,

    Thank you for your note.

    Without the full code we're unable to test on our end.

    If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CortexZenUSA, Today, 12:53 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by CortexZenUSA, Today, 12:46 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by usazencortex, Today, 12:43 AM
    0 responses
    5 views
    0 likes
    Last Post usazencortex  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,266 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X