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

Converting Strategy to Indicator

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

    Converting Strategy to Indicator

    Hello!

    I had to use Strategy Builder to build an indicator and now I want to copy and paste it over from Strategy to Indicator, probably based on this old post: https://ninjatrader.com/support/foru...y-to-indicator

    Since that post is over a decade old and I'm doing this in NT8, can you help me determine which part(s) at the top of the script that I need to swap out? I know there's no guarantee, but I just need a place to start.

    Thanks


    #2
    Hello chartchart,

    Thanks for your post.

    I recommend that you review the strategy inputs and then use the Ninjascript indicator wizard to create the basic indicator structure needed. The wizard will ask for the inputs so rather than copying them over it would be better for the wizard to set them up for you.

    Once completed you can then compare the code structure between the strategy and the blank indicator and copy over the code within the OnBarUpdate(). It is possible that you may need to copy over other parts but there is no uniform or step by step that we can advise to do this. It helps to have an understanding of C# progrmming language.

    You will create errors and will have to address these errors as you go, starting with the top listed error. Once the error is fixed, recompile and check for the next error. Eventually, you should be error-free.

    References:




    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello chartchart,

      Thanks for your post.

      I recommend that you review the strategy inputs and then use the Ninjascript indicator wizard to create the basic indicator structure needed. The wizard will ask for the inputs so rather than copying them over it would be better for the wizard to set them up for you.

      Once completed you can then compare the code structure between the strategy and the blank indicator and copy over the code within the OnBarUpdate(). It is possible that you may need to copy over other parts but there is no uniform or step by step that we can advise to do this. It helps to have an understanding of C# progrmming language.

      You will create errors and will have to address these errors as you go, starting with the top listed error. Once the error is fixed, recompile and check for the next error. Eventually, you should be error-free.

      References:



      How about NinjaTrader adding an "Indicator Builder" next to the Strategy Builder under the Account->New tab?

      Comment


        #4
        Hello MosesMelee,

        Thank you for your suggestion.

        If you would like, I can submit a feature request for this on your behalf.
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Gaby View Post
          Hello MosesMelee,

          Thank you for your suggestion.

          If you would like, I can submit a feature request for this on your behalf.

          Gaby,

          He is one lonely vote of support for a feature request to include an Indicator Builder in future versions as suggested by MosesMelee.

          For non-programmers it is very difficult to work through the errors generated when converting a strategy to an indicator. Student programmers like myself can also have a tough time.

          An Indicator Builder shouldn't be difficult to code using snippets from the Strategy Builder. It would be one more step toward making the platform user friendly.

          Thanks

          Comment


            #6
            Hello,

            I will add your vote to this feature request.
            Gaby V.NinjaTrader Customer Service

            Comment


              #7
              Please add my vote for an indicator builder too.

              Comment


                #8



                chartchart,



                i have been able to create indicators that replicate my strategies to perfection. check out my posts, i think i shared the code in the corresponding threads.


                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NeoTraderBot, Yesterday, 10:55 PM
                0 responses
                6 views
                0 likes
                Last Post NeoTraderBot  
                Started by OliverWaters, Yesterday, 10:35 PM
                0 responses
                6 views
                0 likes
                Last Post OliverWaters  
                Started by Graci117, 07-06-2024, 09:32 AM
                6 responses
                37 views
                0 likes
                Last Post Graci117  
                Started by AdamDJ8, 07-01-2024, 06:50 PM
                2 responses
                121 views
                0 likes
                Last Post AdamDJ8
                by AdamDJ8
                 
                Started by AdamDJ8, 07-01-2024, 05:55 PM
                3 responses
                32 views
                0 likes
                Last Post AdamDJ8
                by AdamDJ8
                 
                Working...
                X