Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TailStop for multiple entrees?

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

    TailStop for multiple entrees?

    Is there a way to implement a trailing stop in a strategy that takes multiple positions to average in. Basically I want to set a 25% trailing stop from the Avg. Position Price each time an additional entree is made.

    #2
    Hello relogical,

    Thank you for your post.

    This is possible by tracking the position size and comparing it to the previous size. Then adjust your Stop Loss price and size based on your desired parameters.

    You can use Position.Quantity to track the quantity: http://www.ninjatrader.com/support/h...7/quantity.htm

    Please let me know if you have any questions.

    Comment


      #3
      Thank you Patrick, how would I adjust the trailing stop each time the AvgPosPrice changes? Could you show me some code examples? Thank you

      Comment


        #4
        There are some different ways this could be done and while I don't have an exact example I will get you pointed in the right direction.

        For advanced order management use this example to get started. It will show you how to setup an auto breakeven stop order through the use of IOrders. When using IOrders you're able to track your orders individually and are given more flexibility when placing your targets and stops:

        The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


        To track the avg fill price you can use this for the whole position: http://www.ninjatrader.com/support/h...l?avgprice.htm
        Or this for an individual IOrder: IOrder.AvgFillPrice http://www.ninjatrader.com/support/h...tml?iorder.htm


        Let me know if I can further assist.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DavidHP, Today, 07:56 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        6 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Mindset, Yesterday, 02:04 AM
        2 responses
        17 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Started by f.saeidi, Today, 08:03 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by samish18, 04-17-2024, 08:57 AM
        15 responses
        52 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X