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

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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by dcriador, Today, 12:06 PM
    0 responses
    10 views
    0 likes
    Last Post dcriador  
    Started by dcriador, Today, 12:04 PM
    0 responses
    6 views
    0 likes
    Last Post dcriador  
    Started by cutzpr, Today, 08:54 AM
    0 responses
    11 views
    0 likes
    Last Post cutzpr
    by cutzpr
     
    Started by benmarkal, Today, 08:44 AM
    0 responses
    23 views
    0 likes
    Last Post benmarkal  
    Started by Tin34, Today, 03:30 AM
    2 responses
    29 views
    0 likes
    Last Post Tin34
    by Tin34
     
    Working...
    X