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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X