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

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 funk10101, Today, 09:43 PM
    0 responses
    6 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Started by yertle, Today, 08:38 AM
    6 responses
    26 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Working...
    X