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

Scaling Out of a Position

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

    Scaling Out of a Position

    I want to set up multiple targets to scale out of a potion: 6, 9, 12, 18 Ticks from entry. I cannot get it to work properly in the NT8 Strategy Builder. The parameters show up, but they do not scale out.

    Please advise. Thanks!

    #2
    Also, is it possible to have Ninja Traders Strategy Builder trigger an ATM Strategy? I have an ATM strategy with the targets listed above. It also allows me to move them in real time if I decide to... as opposed to the Strategy Builder targets

    Comment


      #3
      Hello rjsjr64,

      Thanks for your post.

      To accomplish your goal in the Strategy Builder, you will have to create separate entries for each exit and use signal names to tie them together (This entry with that profit target and that stop).

      For example:

      (your conditions to enter)
      EnterLong("First");
      EnterLong("second");
      EnterLong("Third");
      etc etc.

      If you want to you can use 1 stoploss that would apply to all: SetStopLoss(CalculationMode.Ticks, 10); // applies to all entries
      Or you can set individual stops if you prefer by using the signal name, for example
      SetStopLoss("First", CalculationMode.Ticks, 10); // applies only to the entry named "First"
      SetStopLoss("second", CalculationMode.Ticks, 12); // applies only to the entry named "second"
      etc, etc.

      Finally, for the individual profit targets, you would need to specify them like:
      SetProfitTarget("First", CalculationMode.Ticks, 6);
      SetProfitTarget("second", CalculationMode.Ticks, 9);
      SetProfitTarget("Third", CalculationMode.Ticks, 12);
      etc, etc.

      NOTE: The signal names for the stops and profit targets must match exactly the name used in the entry.


      Reply to post #2

      You cannot use an ATM with the strategy builder.

      What you want to work with is a Ninjascript strategy that uses an ATM template to accomplish your goals where the strategy will find the entry conditions and place the entry order, once filled the specified ATM will take over providing the template specified profit and stop(s). You can then manipulate these manually during the trade as you wish. Once the trade has been closed, the strategy will look for the next entry.

      In your NinjaTrader is an example of this type of strategy called SampleAtmStrategy. Please review this strategy in the Ninjascript editor as the code is the best example we have of this type of hybrid strategy. The code of the strategy is well commented to help understand the requirements of use as well as how the various property and methods work. The comments advise to create an ATM template (for the demonstration) called "AtmStrategyTemplate" and it can be created as you wish to configure it.

      The sampleATMstrategy uses special methods and properties that do not access the normal strategy methods and properties, here is a link to the help guide section on these special ATM methods and properties: https://ninjatrader.com/support/help...gy_methods.htm

      Please note:
      1. The Strategy Builder does not support ATMs
      2. Strategies that use ATM methods cannot be "backtested" in the strategy analyzer.
      3. Strategies that use ATM methods can be tested with Playback using Market replay data.
      4. Strategies that use ATM methods need to skip historical data processing (as shown in the example strategy).


      Paul H.NinjaTrader Customer Service

      Comment


        #4
        I think I did as you suggested, but when triggered only the entry 1 takes place, and it hits the 6 tick target. But the other 3 orders never filled.
        Attached Files

        Comment


          #5
          Also, I do not have SampleAtmStrategy in my Strategy Builder... I must have deleted it. Can you attach the file for me and I'll add it to the correct folder? Thanks!

          Comment


            #6
            Hello rjsjr64,

            Thanks for your reply.

            ...but when triggered only the entry 1 takes place
            The reason for that is because the default Strategy Builder properties of EntriesPerDirection is set to 1 and the EntryHandling is set to "all entries", so this means you would only get 1 entry. What you need to do is to set the Entry Handling parameter to "Unique Entries". Unique Entries are those that have signal names. Leave the entries per direction at 1, this way you can have 1 entry per signal name.

            You can edit the property in the Strategy Builder on the "Default Properties" window under "More Properties".
            You can also set (and check) the property when you apply the strategy. https://ninjatrader.com/support/help...tegyProperties

            The Sample ATM strategy is not available in the Strategy Builder. To access it you have to go to New>Ninjascript Editor>Strategies>
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              I already had it set to 1 Entry Per Direction and Unique Entries. It was not working. However, by changing it on the strategy on the chart, it started working. THANKS!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              10 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              14 views
              0 likes
              Last Post AaronKoRn  
              Started by carnitron, Yesterday, 08:42 PM
              0 responses
              11 views
              0 likes
              Last Post carnitron  
              Started by strategist007, Yesterday, 07:51 PM
              0 responses
              14 views
              0 likes
              Last Post strategist007  
              Started by StockTrader88, 03-06-2021, 08:58 AM
              44 responses
              3,983 views
              3 likes
              Last Post jhudas88  
              Working...
              X