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

stoplosses

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

    stoplosses

    Hi

    If I have 2 orders and corresponding 2x stoploss, 2x profit target.

    Do the stoplosses and profit targets close in the order they were placed on the market or is it like last in first out.

    so if
    sl1 and pt1 enter the market first THEN
    sl2 and pt2 enter the market.

    if pt1 is hit then based on the signal names / signal from fields it should be sl1 which is cancelled or is there any way sl2 could be cancelled first?

    #2
    Hello fishbed,

    Thank you for your post.

    If you are using the Set methods (SetProfitTarget, SetStopLoss, etc.) then the associated Stop Loss by entrySignalName will be cancelled - so to your example; if pt1 is hit then sl1 is cancelled.

    If you use specific Exit order methods (ExitLongStopMarket, ExitLongLimit, etc.) then you will need to ensure the orders are associated to the correct entrySignalName - and then the case would be the same as using the Set methods.

    If your orders are not specific to entrySignalNames (the entry orders) then to change this you would use Order objects specifically for each order and check for the fill of an order in the OnOrderUpdate() method and then use CancelOrder() to cancel the order you want.
    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kempotrader, Today, 08:56 AM
    0 responses
    6 views
    0 likes
    Last Post kempotrader  
    Started by kempotrader, Today, 08:54 AM
    0 responses
    4 views
    0 likes
    Last Post kempotrader  
    Started by mmenigma, Today, 08:54 AM
    0 responses
    2 views
    0 likes
    Last Post mmenigma  
    Started by halgo_boulder, Today, 08:44 AM
    0 responses
    1 view
    0 likes
    Last Post halgo_boulder  
    Started by drewski1980, Today, 08:24 AM
    0 responses
    3 views
    0 likes
    Last Post drewski1980  
    Working...
    X