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 Karado58, 11-26-2012, 02:57 PM
        8 responses
        14,828 views
        0 likes
        Last Post Option Whisperer  
        Started by Option Whisperer, Today, 09:05 AM
        0 responses
        1 view
        0 likes
        Last Post Option Whisperer  
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by Harry, 05-02-2018, 01:54 PM
        10 responses
        3,204 views
        0 likes
        Last Post tharton3  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Working...
        X