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

Taking Partial Profits

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

    #16
    Originally posted by NinjaTrader_Josh View Post
    Hi molecool,

    I understand it is a major inconvenience in complicated strategy code. I wish I could fix it in NT7 too. For this particular bug I drove many discussions with our development team investigating different approaches to try and get this done, but unfortunately the nature of this bug is all the way down to the core handling of the managed approach. It would require a bit of nasty overhauling in this extremely sensitive area of NT code. The risk of things breaking is extremely significant since there are so many intertwined components here that unfortunately we will not be able to address it in NT7. I wish I could give you a different story here, but can only thank you for your understanding and patience on this matter.
    Appreciate that and having been in your shoes I do understand. I'll try to work around it somehow.

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      Hi koganam and molecool,
      Here are the scenarios available:

      Scenario 1
      - Single entry order for multiple contracts (Doesn't matter if it was an EnterLong or EnterLongLimit/etc.)
      - Multiple ExitLong orders of smaller quantities to scale out of that position generated from a single entry order
      - Backtesting <-- works
      - Real-time <-- does NOT work. Bugged. Will NOT continue to scale out of the position. Has been tagged for resolution in NT8

      Scenario 2
      - Single entry order for multiple contracts (Doesn't matter if it was an EnterLong/etc.)
      - Multiple ExitLongLimit/Stop orders of smaller quantities to scale out of that position generated from a single entry order (a.k.a. exiting the same fromEntrySignal name)
      - Backtesting <-- expected to NOT work
      - Real-time <-- expected to NOT work
      - NT's managed approach was not designed to allow for closing the same fromEntrySignal twice in this manner. You will get a message like this: "There is already a matching filled order in place". This was not meant to work this way and won't work this way.


      Scenario 3
      - Multiple entry orders to acquire multiple contracts
      - Multiple ExitLongLimit/Stop orders of quantities matching the entry order quantities
      - Backtesting <-- works
      - Real-time <-- works
      - When using entry orders A, B, C and corresponding ExitLongLimit/Stops with matching quantities of A, B, C, you will be able to scale-out properly. Note that each exit order is associated to its own entry order.


      Scenario 4
      - Unmanaged approach
      - Scale in/out works regardless of what you are doing

      molecool, from my understanding of what you are trying to achieve, unfortunately the current options available are either scenario 3 or 4.
      I think I know the answer to my following question, but just wanted to confirm before I modify my strategy to use Scenario 3 (multiple entries on the same signal using different signalnames so that I can take partial profits).

      I'd like to be enter a position and create partial profit target 1, partial profit target 2 and stoploss. My understanding is that this would fall into Josh's Scenario 2 as profit targets are effectively ExitLongLimit orders, and as such, cannot be effected for only part of a position using the Managed Approach.

      So if I wanted to effect partial profit targets using the Managed Approach, I have to create multiple entries for a signal (i.e., signalA_entry1, signalA_entry2, signalA_entry3) that sum up to the total position I want on signalA. Then I could have a profit target and stop loss for each of these named entries.

      Is this correct?

      Comment


        #18
        Hi dolomite,

        That is correct, the proper way to accomplish this is by making each partial target its own order.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Walk Forward Multiple Targets

          Hello,

          i thought that i dont have to create a new topic for my question, so i ask here.

          I use multiple Targets too and want , that the different targets have a minimum distance from each other. In Optimization the Pc often search the one optimal targetpoint, which is good in optimization but not in walk forward.

          in MQL4 it works if i change the OrderOpenCondition like that (Target1 < (Target2-5))
          but in Ninja the tester sometimes make nothing because he says no result is the best result and takes for example Target1 =10 and Target2 =10.

          How i can divorce each other with a minimum distance?

          best regards

          Comment


            #20
            FX90903, this would be possible via the properties, consider this example snippet taken from our SampleMACrossOver. You cannot set a lower value for Slow than Fast + 1. So with the default values if you try a value lower than 10 for Slow > it will change the value to 11.

            Code:
                            [Description("Period for fast MA")]
            		[GridCategory("Parameters")]
            		public int Fast
            		{
            			get { return fast; }
            			set { fast = Math.Max(1, value); }
            		}
            
            		[Description("Period for slow MA")]
            		[GridCategory("Parameters")]
            		public int Slow
            		{
            			get { return slow; }
            			set { slow = Math.Max(fast + 1, value); }
            		}
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Thx a lot, it works now.

              best regards

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ETFVoyageur, Today, 08:54 AM
              3 responses
              16 views
              0 likes
              Last Post ETFVoyageur  
              Started by ETFVoyageur, Today, 02:15 AM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Andrei60, Today, 08:56 AM
              0 responses
              6 views
              0 likes
              Last Post Andrei60  
              Started by ETFVoyageur, Today, 06:11 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by Belfortbucks, Today, 08:21 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X