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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    38 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    287 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    289 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    134 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    95 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X