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

specific and general question around managed orders

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

    specific and general question around managed orders

    Hi. I'm using managed approach where I generate a number of trades on the same instrument, and simultaneously enter the stop/ target levels for each trade. This is working fine.
    However, ideally I would like to implement trailing stops. Presumably the way to do this is with each bar update, take each individual stop order and update it to reflect the latest price move if appropriate. However, I don't know how to refer back to each Stop Order, as my entry signals identify the stop order based on bar number at time of entry.
    Is there a way just to cycle through all outstanding stop orders without know their specific names? Are you guys aware of more elegant approaches out there to implementing trailing stops on trade by trade basis in the unmanaged framework?
    thanks

    #2
    Hello stewarco,

    You can use SetTrailStop in the managed approach with unique signal names and these will keep the trailing stops separate.

    If you are using the unmanaged approach, you must be able to identify the order.

    You can loop through all the orders on an account, but if you did so, how would you know for any specific order when it needs to trail?

    You would need to either identify the order by signal name / from entry signal, or you would need to store these to an array or list and index them in an intelligent way to know what goes with what.

    Below is a public link to an example of a trailing stop using the unmanaged approach.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,262 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by WeyldFalcon, 12-10-2020, 06:48 PM
    14 responses
    1,429 views
    0 likes
    Last Post Handclap0241  
    Started by DJ888, 04-16-2024, 06:09 PM
    2 responses
    9 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    41 views
    0 likes
    Last Post jeronymite  
    Working...
    X