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

Profit Target as a multiple.

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

    Profit Target as a multiple.

    Can I make the Profit Target a multiple of the Stop Loss? For example if I use the low of a bar as a stop loss then can NT8 automatically take that amount and make a profit target based on that generated number?

    Also can I add or subtract ticks from the low or high of a bar used for a stop?

    Say if the stop loss is say 20 ticks then I want profit to be a multiple of that 20 tick stop calculated in NT8. Like 1=20 or 1.5=30 or 0.5=10 and so on.

    Thanks.

    #2
    Hello Trader17,

    Thanks for your post.

    In Ninjascript which is based on C# you can perform most any calculation. To accomplish your goals you can use the property TickSize which will provide the price per tick value of the instrument the strategy is connected to. Reference: http://ninjatrader.com/support/helpG.../?ticksize.htm (Example shows how to subtract 1 tick from the Low[0])
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      So if I need to subtract 2 ticks then I use:

      // Prints the ticksize to the output window
      Print("The ticksize of this instrument is " + TickSize);

      // Prints the value of the current bar low less one tick size
      double value = Low[0] - TickSize[2];
      Print(value);

      Sorry am new to all this.
      Thanks.

      Comment


        #4
        Also how can I make the multiple of Stop Loss as a Profit Target?

        Thanks.

        Comment


          #5
          Hello Trader17,

          Thanks for your reply.

          To subtract by 2 ticks you would use Low[0] - 2 * TickSize;
          To add 5 ticks, it would be High[0] + 5 * TickSize;
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Hello Trader17,

            Thanks for your reply.

            To calculate a multiple would depend on how you are specifying your stop loss.

            If, for example, you are using SetStopLoss(CalculationMode.Ticks, 20); then you could use any multiplier you wish. For example, if you want a profit target of 3 times your stop level it would be 3 * 20 = 60 ticks, SetProfitTarget(CalculationMode.Ticks, 60);
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thank you. I will be using the low or high of a bar as a stop. So will NT8 be able to calculate the profit target based on what the stop loss will be? Like say based on low or high the stop will be 13 ticks. Can Ninja take that number and use it as the profit target with or without a multiple?
              Thanks.

              Comment


                #8
                Hello Trader17,

                Thanks for your reply.

                To be clear NT8 will only do what you tell it to regarding the profit and stop level, there is no automatic calculation of profit/stop by one or the other based on some multiplier.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  So basically NT8 will use only the number of ticks specified for stop and target. SO calculating a target based on the stop specified is more of a custom coding job? Can Ninja help me code it?
                  Thanks.

                  Comment


                    #10
                    Hello Trader17,

                    Thanks for your reply.

                    No, in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

                    If you would like it coded for you, we can provide links to 3rd party coders who would be able to provide that service.

                    If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.
                    a link to our help guide can be found below



                    This video introducing the NinjaScript editor is an excellent resource,

                    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.3:11 Creating a New NinjaScript Strategy13:52 Analyz...


                    You will find reference samples online as well as some tips and tricks for both indicators and strategies:




                    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

                    There is also a growing library of user submitted custom indicators (100+) and strategies that can be downloaded from our support form. Please look in the NinjaScript file sharing section of our support forum as you may find what you are looking for there:



                    Finally, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Thank you. Please provide me a list of third party vendors who code.
                      Thank you.

                      Comment


                        #12
                        Hello Trader17,

                        This is Ryan L. from the NinjaTrader Ecosystem responding on behalf of my colleague Paul.

                        You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!

                        This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                        Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.
                        Ryan L.NinjaTrader Customer Service

                        Comment


                          #13
                          Thanks. Can the ATR value be used for targets and stops or it has strictly to be in ticks only.
                          Thanks.

                          Comment


                            #14
                            Hello Trader17,

                            Thanks for your post.

                            Yes, the ATR value can be used. You can convert any price type value into ticks by using TickSize. For example, using the ES, the tick size is 0.25. If the ATR value is 2, then the number of ticks would be 2 / TickSize = 8 ticks.

                            You do not have to use ticks, you can use price however in the case of the ATR value, from the example above if you used the ATR value of 2 that would not relate to the current price of ES which is over 2400. So you would likely need to add or subtract the ATR value (or some multiple of it) from the current price in order to set the appropriate profit or stop price levels.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Thanks. So the ATR will always be in points. And I need to divide it by Tick Size for stop/target.
                              Thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by quantismo, 04-17-2024, 05:13 PM
                              4 responses
                              30 views
                              0 likes
                              Last Post quantismo  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              31 views
                              0 likes
                              Last Post love2code2trade  
                              Started by cls71, Today, 04:45 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post eDanny
                              by eDanny
                               
                              Started by proptrade13, Today, 11:06 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post proptrade13  
                              Started by kulwinder73, Today, 10:31 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X