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 know if a strategy placed a buy order

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

    How to know if a strategy placed a buy order

    Hello!

    There is some function in ninjascript that lets me know when I made a buy order (And I have not sold). ? Thanks

    #2
    Hello 7robert,

    Thanks for your post.

    Typically within NinjaScript, you would check the strategy's position with Position.MarketPosition and Position.Quantity to get the quantity in that direction.

    If you would like to track when an order is pending or has been submitted, cancelled or filled, I recommend using OnOrderUpdate for this purpose. It can also be helpful to track each order as their own Order object.

    Position - https://ninjatrader.com/support/help...s/position.htm

    OnOrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm

    SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    Please let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Fran888, 02-16-2024, 10:48 AM
    3 responses
    44 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by martin70, 03-24-2023, 04:58 AM
    15 responses
    114 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by The_Sec, Today, 02:29 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by jeronymite, 04-12-2024, 04:26 PM
    2 responses
    31 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Mindset, 05-06-2023, 09:03 PM
    10 responses
    265 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X