Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detecting a Posting Exit

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

    Detecting a Posting Exit

    I am working on code in which I enter the market all-in and exit the market by scaling out. I have reviewed previous posts and have incorporated entering with multiple order each using a unique id. I also use SetProfitTarget and SetStopLoss to manage the exits. Works fine.

    I am looking for a way to determine when my first target is reached via SetProfitTarget (1st lot id) and then move my stop for the second lot dynamically based on other indicators (not just a trailing stop using ticks). I have also reviewed OnExecution() but cannot find a way. I could add code that checks the current price against the 1st lot target but I was hoping for a more accurate/less cumbersome method.

    Are there methods or properties exposed to handle this?

    Thanks

    #2
    Yes, you would have to work with IOrder objects to track when your first target reports filled - http://www.ninjatrader-support.com/H...V6/IOrder.html

    You can also review this sample for more details - http://www.ninjatrader-support2.com/...ead.php?t=7499

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, Yesterday, 01:02 PM
    0 responses
    29 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    21 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X