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

NT7 to NT8 indicator conversion help

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

    NT7 to NT8 indicator conversion help

    Hello guys,

    is there any kind soul who can convert this NT7 indicator into NT8? Thank you in advance.

    Kind regards
    Attached Files

    #2
    Hello murena80,

    Thank you for writing in.

    I would highly suggest taking a look at the Code Breaking Changes section of the NinjaTrader 8 help guide for a high level overview of the syntax changes you can expect between NinjaTrader 7 and 8: https://ninjatrader.com/support/help...ng_changes.htm

    If you would like, I would be happy to forward you to our business development team who can connect you to a NinjaScript consultant to assist with converting your code.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by murena80 View Post
      Hello guys,

      is there any kind soul who can convert this NT7 indicator into NT8? Thank you in advance.

      Kind regards
      murena,

      Not a big deal, using Wil Bennett's great tool, here is your Indicator for NT8.

      Cheers!
      Attached Files

      Comment


        #4
        Originally posted by aligator View Post
        murena,

        Not a big deal, using Wil Bennett's great tool, here is your Indicator for NT8.

        Cheers!



        Thank you so much aligator!!

        Wish you the best in your trading!

        Comment


          #5
          Hello,

          is there somebody who can help me to convert this syntaxes from NT7 to NT8:

          NinjaTrader.NinjaScript.Indicators.MyLineNew2 line = new NinjaTrader.NinjaScript.Indicators.MyLineNew2();

          line.Input=(input);
          Indicators.Add(line);
          line.SetUp();

          I have issue with these lines

          line.Input=(input);
          Indicators.Add(line);
          line.SetUp();

          Thank you
          Last edited by miroslav; 10-12-2016, 10:57 AM.

          Comment


            #6
            Hello miroslav,

            If you are interested in converting NinjaTrader 7 code to NinjaTrader 8, you will want to review the information behind this link.



            If you would like the services of a certified NinjaScript consultant please let us know and we can provide more information.

            Otherwise, if you could explain what your goals are with those three lines, and the specific output you are getting when you try to compile or execute your code, we will be happy to help with any specific questions you have.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Hello Jessica,

              thank you for link you have provided. I am trying to resolve some erro I am receiving in this indicator and found out that there is missing some part of the code which in NT7 was part of the userdefined method.


              Here is more of the code

              private double MyCCI(ISeries<double> input)
              {
              if (this.cacheMyCCI != null)
              {
              for (int i = 0; i < this.cacheMyCCI.Length; i++)
              {
              if (this.cacheMyCCI[i].EqualsInput(input))
              {
              return this.cacheMyCCI[i][0];
              }
              }
              }
              lock (checkMyCCI)
              {
              if (this.cacheMyCCI != null)
              {
              for (int k = 0; k < this.cacheMyCCI.Length; k++)
              {
              if (this.cacheMyCCI[k].EqualsInput(input))
              {
              return this.cacheMyCCI[k][0];
              }
              }
              }
              NinjaTrader.NinjaScript.Indicators.MyLineNew2 line = new NinjaTrader.NinjaScript.Indicators.MyLineNew2();

              line.Input=(input);
              // base.Indicators.AddPlot(line);
              line.AddPlot(new Stroke(Brushes.Yellow,2),PlotStyle.Line, "");
              NinjaTrader.NinjaScript.Indicators.MyLineNew2[] array = new NinjaTrader.NinjaScript.Indicators.MyLineNew2[(this.cacheMyCCI == null) ? 1 : (this.cacheMyCCI.Length + 1)];
              if (this.cacheMyCCI != null)
              {
              this.cacheMyCCI.CopyTo(array, 0);
              }
              array[array.Length - 1] = line;
              this.cacheMyCCI = array;
              return line [0];
              Last edited by miroslav; 10-12-2016, 11:58 AM.

              Comment


                #8
                Thank you for this additional information miroslav. What questions may we answer about your code, or about the operation of NinjaTrader?
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  well I was trying to search forum, help and other resources to get some hint to resolve this three lines. The rest looks ok.

                  Comment


                    #10
                    It is not immediately obvious what your goal is with those three lines. Can you describe their function? line.Input is not a documented method.
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello,

                      yes, you are right line.Input is not standard method. What I want to achive it that line Input is same as input from plot
                      line:

                      private double MyCCI(ISeries<double> input)

                      with
                      Indicators.Add(line); = I would like to call plot and in the code you can see that I am trying to do it
                      line.SetUp(); = I would like to achive that plot "line" is set up.

                      Curious is that in NT7 it is working but in NT8 is not and I did not even find it in the code breaking changes

                      Comment


                        #12
                        It looks like we need to examine your MyLineNew2 indicator's source. You should see a line in MyLineNew2 that looks like either

                        Code:
                        public Series<double> Input;
                        or

                        Code:
                        public ISeries<double> Input;
                        If you do not see either of these, please add them to your MyLineNew2 indicator's source and recompile. If you are still unable to set this variable, please let us know and we can investigate further.
                        Jessica P.NinjaTrader Customer Service

                        Comment


                          #13
                          Hello Jessica,

                          it helps to resolve the issue with input. With those two errors is my solution appropriate covnersion from NT7 ton NT8? I meant (line.AddPlot.......) and line.SetUp();?

                          One more thing it seems I am trying to reach index bar which is out or inder range. I am trying to catch error with Log(). Is there some example or approach to see how many bars need to be inserted in the condition (if(CurrentBar>=xyz) then do something.

                          thank you
                          Attached Files

                          Comment


                            #14
                            Hello miroslav,

                            I am glad my advice was able to get you past that compile message. The other two lines of code can be solved the same way we resolved the first line. I am providing you with some links which will help you resolve your query.

                            This publicly available MSDN link will explain the access protection portion of our solution.
                            All types and type members in C# have an accessibility level that controls whether they can be used from other code. Review this list of access modifiers.


                            This publicly available MSDN link will explain the member we exposed
                            Classes and structs in C# have members that represent data and behavior, including members declared in the class and declared in its inheritance hierarchy.


                            Together, those links, and the help I provided to resolve the first line, can be used in combination to resolve your second and third lines.

                            I would also like to recommend the terrific resources available here.


                            If you would like more line-by-line assistance with detailed explanations regarding your MSDN C# code, I would be happy to help you find a certified NinjaScript consultant who can provide this level of service.
                            Jessica P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by jclose, Today, 09:37 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post jclose
                            by jclose
                             
                            Started by WeyldFalcon, 08-07-2020, 06:13 AM
                            10 responses
                            1,413 views
                            0 likes
                            Last Post Traderontheroad  
                            Started by firefoxforum12, Today, 08:53 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post firefoxforum12  
                            Started by stafe, Today, 08:34 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post stafe
                            by stafe
                             
                            Started by sastrades, 01-31-2024, 10:19 PM
                            11 responses
                            169 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Working...
                            X