Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

From within an Indicator, detect any orders submitted manually or by a strategy

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

    From within an Indicator, detect any orders submitted manually or by a strategy

    From within an indicator, I want to detect when an order has been entered/filled/exited. The orders can be submitted from a strategy or manually, but not from the indicator itself.

    I want to detect and track the progress of the orders to completion purely from the indicator. I know it is possible to reference the Strategy namespace in an indicator to access constructs within a strategy, but orders may be submitted manually too, so relying on a strategy is not suitable.

    Any thoughts?

    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello,

    Thank you for the question.

    There is not a documented way to do what you are looking for. I would like to provide a sample script that should get you going in the direction you want to.

    I would like to note that this is undocumented code and is not supported; therefore any questions pertaining to this script may or may not be answered by support.

    What this script does is the following process:
    • OnStartUp:The indicator loops through the available accounts and gets the specified account set in the variables.
    • If the account is found, it attaches Execution, OrderStatus, PositionUpdate, and ConnectionStatus handlers to the account.
    • If there is an event that happens, one of the handlers that was attached will catch the event
    • OnTermination: loops through the accounts again and finds the specified account - then removes the handlers so that when the chart is closed or the indicator is removed the actions can no longer happen.


    This should give you the information you need to get the account position and other information in an indicator.

    I should also note that this is set up to print the status's to the Output window (Tools -> Output Window)

    Please let me know if I may be of additional assistance.
    Attached Files

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    577 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X