Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to find order and check status

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

    How to find order and check status

    Hi,

    sry for stupid question, but I´m newbie in ninjascript.

    I can put any order (for example limit order), but don´t know how check order status (later). So...

    1) How check order status?
    2) How detect whether order still exists or not?
    3) How to get volume (quantity) of order?

    For example, i want move a limit order to new price via "ChangeOrder()". How to do it?

    Thank you.

    #2
    Hello rozirozi,

    Thank you for writing in.

    To check whether an order was filled, within OnExecutionUpdate you could check if the name of the entry order was filled and if so, assign a true value to a bool variable for which you could use in OnBarUpdate. I have provided a sample strategy which will execute a new trade and print whether the order is filled or not. Please see attached.

    To get the volume of the order you could use execution.Quantity within OnExecution. Within the sample strategy I provided a print statement referencing this value.

    See Execution section of our helpguide,


    See OnExecutionUpdate section of our helpguide.


    I have provided a second example built similar to the first, but using a limit order rather than a market order as the entry order. In this sample, if that limit order is not filled within 2 bars of being submitted, the strategy calls the ChangeOrder method and modifies the limit orders price.

    See Change Order Section of our helpguide,


    In the sample strategies I would suggest applying them to a 5 second chart and pulling up an output window.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X