Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders: Setting trailstop on open position

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

    Orders: Setting trailstop on open position

    How do I execute a trail on an existing position? I did not use an ATM strategy for entry.

    #2
    Hello TraderMatt83,
    Unfortunately you can not add a Trailing Stop to an order that has already been added.
    I will submit a vote to our development team to add this feature in future versions of NinjaTrader.
    If I can be of any other assistance please let me know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      That's kind of a bummer, considering this has been standard in ToS for quite some time. Can I create a strategy to trail for me as a workaround? If so, would you have example I could use?

      Comment


        #4
        Hello TraderMatt83,

        To use a strategy to add a trailing stop to an existing order, you will need to first detect that a manual order has been placed.

        Strategies are not designed to detect orders that are not made by the strategy. You will need to use unsupported methods to achieve this.

        Once the order is detected, you will need to place the exit order, and then use custom logic to make the trailing action.

        Below I am adding unsupported code to help guide you in the right direction.
        foreach (Account acct in Cbi.Globals.Accounts)
        {
        if (acct.Positions != null)
        {
        // print information about each position
        PositionCollection positions = acct.Positions;
        foreach (Position pos in positions)
        {
        Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
        }
        // print information about each order
        OrderCollection orders = acct.Orders;
        foreach (Order ord in orders)
        {
        Print(ord.ToString());
        }
        }

        Also, I am attaching an example of a custom trail.


        Do keep in mind that this enhancement is on the list of enhancements under consideration for NinjaTrader 8.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello TraderMatt83,

          It is very easy to do that using our ChartTraderPRO Add-On.



          You can add, modify, delete SL, TP and start to Trail anytime, even during the trade, without problems.

          If you have any question, I'll be happy to assist.

          Regards

          Lorant Vari

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          30 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          943 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          9 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by rocketman7, Today, 01:00 AM
          0 responses
          7 views
          0 likes
          Last Post rocketman7  
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          28 views
          0 likes
          Last Post wzgy0920  
          Working...
          X