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

Coding Help Needed

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

    Coding Help Needed

    Okay, thanks Jesse! I'll go through the Print technique first to see if it could further be reduced.

    Mukaddim
    Last edited by Mukaddim; 10-05-2018, 10:51 PM.

    #2
    Hello Mukaddim,

    Thank you for your note.

    1. NinjaTrader.Indicator == NinjaTrader.NinjaScript.Indicators
    2. NinjaTrader.Gui.Design is not documented, perhaps you can provide more information on what you’re trying to do, where you’re calling it, and I will try to provide some guidance.
    3. NinjaTrader.Strategy; == NinjaTrader.NinjaScript.Strategies
    4. Not documented need more info.
    5. Not documented need more info.
    6. Not documented need more info.
    7. https://ninjatrader.com/support/help...-us/?plots.htm
    8. https://ninjatrader.com/support/help...font_class.htm

    There is not an official indicator/strategy converter which takes scripts from NT7 and converts them to NT8 however on the forum there is a post which provides script for conversion.



    I’d like to mention its best to do a manual conversion for accuracy as not all scripts are simple enough to be converted directly.

    Also below I’ve provided a link to code breaking changes which you should consider when converting your scripts:



    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you AlanP, Will provide you the snippets for undocumented ones. I am doing the manual conversion. The conversion script gives me an error which I asked about here https://ninjatrader.com/support/forum/newreply.php?do=newreply&p=543775, unfortunately it prodeced nothing for me.

      Comment


        #4
        Hello Mukaddim,

        There is no documented source of unsupported or undocumented methods.

        The link you provided does not provide any information, if you'd like to provide another link I will take a look.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Hi AlanP,
          No worries, I'll get you the details of 4, 5 and 6 queries. I'm not much into that script either. Would like to do manual conversion.
          Thanking
          Mukaddim

          Comment


            #6
            Originally posted by Mukaddim View Post
            Hello,
            Could anyone please let me know the NT8 equivalents of the following NT7 namespace/statements/declarations?

            1. NinjaTrader.Indicator;
            2. NinjaTrader.Gui.Design;
            3. NinjaTrader.Strategy;

            4.Data.BarsType.Supported.Length;
            5.BarsType.GetInstance(type).DisplayName;
            6.Class MyClass: BarData
            7.base.Plots[0].Pen.Width = 3f;
            8.Font TextFont = new Font("Arial", 8f, FontStyle.Bold);

            I'm trying to convert NT7 indicators to NT8 ones. Your assistance is highly appreciated.

            Rubel
            Hi AlanP, please find below the NT7 codes for queries no. 4, 5 and 6

            4. & 5.
            private MyPeriodTypeSupported()
            {
            this.miAddIndicator = this.AddPeriodMethodInfo(typeof(IndicatorBase));
            this.miAddStrategy = this.AddPeriodMethodInfo(typeof(StrategyBase));
            this.dictionaryPeriodTypes = new Dictionary<string, PeriodType>
            (BarsType.Supported.Length);

            foreach (PeriodType type in BarsType.Supported)
            {
            try
            {
            string displayName = BarsType.GetInstance(type).DisplayName;
            this.dictionaryPeriodTypes.Add(displayName, type);

            }
            catch (Exception)
            {
            }
            }
            }


            6.

            namespace NinjaTrader.Gui.Chart
            {
            public class MyBarsDataPeriod : BarsData
            {
            protected PropertyDescriptorCollection adjustedProps;
            private BarsPeriodType previousId = PeriodType.Minute;
            private static ExpandableObjectConverter cv = BarsDataConverter;

            }

            Appreciate your help
            Mukaddim

            Comment


              #7
              Hello Mukaddim,

              So I may best answer your questions, it would be helpful if you could provide a use case for each example as there may be a different/better approach to achieving what you’re looking to do in NT8.

              I look forward to your reply.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by Mukaddim View Post
                I'm trying to convert NT7 indicators to NT8 ones. Your assistance is highly appreciated.
                This thread might help get you started,

                Comment


                  #9
                  Originally posted by bltdavid View Post
                  This thread might help get you started,
                  https://ninjatrader.com/support/foru...ad.php?t=79551
                  Hi, Thanks for pointing out to the conversion script.
                  It gives me the following error. Any work around the issue?



                  Thanking
                  Mukaddim
                  Attached Files

                  Comment


                    #10
                    Originally posted by NinjaTrader_AlanP View Post
                    Hello Mukaddim,

                    So I may best answer your questions, it would be helpful if you could provide a use case for each example as there may be a different/better approach to achieving what you’re looking to do in NT8.

                    I look forward to your reply.
                    Hi AlanP,
                    What do I have to do? I'm trying to convert a .cs class file that is required for a set of indicators. So would you like to look at the NT7 code for it?
                    Thanking
                    Mukaddim

                    Comment


                      #11
                      Originally posted by Mukaddim View Post
                      Hi, Thanks for pointing out to the conversion script.
                      It gives me the following error. Any work around the issue?
                      I'm not familiar with that error. You can try asking in that script conversion thread.

                      Originally posted by Mukaddim View Post
                      What do I have to do? I'm trying to convert a .cs class file that is required for a set of indicators. So would you like to look at the NT7 code for it?
                      I'll be in the same boat myself soon, I have some abstract class files used by a family of indicators that I must convert first -- which sounds very similar to your situation.

                      If you are comfortable posting your .cs class file here, I'll try to convert it with the above conversion script and see how far I can get.

                      Comment


                        #12
                        Originally posted by Mukaddim View Post
                        Hi, Thanks for pointing out to the conversion script.
                        It gives me the following error. Any work around the issue?
                        Also, here's an interesting tip:
                        Whenever you get an error message like this, copy & paste the entire error message (or most of it) into Google search, you'd be surprised what Google will turn up.

                        For example, Google found this,


                        In other words, treat arcane error messages as research questions and start Googling & then read anything that turns up. Sounds simple, but this tip is not completely obvious, it wasn't obvious to me until I saw a colleague do it. Give it a try!

                        Good luck!

                        Comment


                          #13
                          Hi bltdavid,
                          Can we skype to do the sharing? I can't post in that conversion thread, no idea why. I posted the error details in another thread. It didn't turn up any fruitful solutions, since it's undocumented.

                          Thanks for your guidance, Appreciate it.
                          Mukaddim

                          Comment


                            #14
                            Hello Mukaddim,

                            There would not be enough information to determine what that error is.

                            Converting customer code is out of the scope of NinjaScript support however if you’d like I could have someone from our business development team pass over a list of third party developers that you could contact about debugging your code.

                            The following link on conversion may be of interest to you,


                            Please let us know if you need further assistance.
                            Alan P.NinjaTrader Customer Service

                            Comment


                              #15
                              No worries AlanP, thanks for your responses. Would you please tell me what the following error means and the way to solve it? Can't find any documentation on it.

                              int barsAgo = iBar - sPoints.bOfHigh;

                              HighDot.Set(barsAgo, sPoints.hPoint); //on NT7 is converted to
                              HighDot[0] = (barsAgo, sPoints.hPoint); //on NT8

                              It gives errors with codes CS1026, CS1525, CS1002 along with "; expected", ")
                              expected". It also gives a red squiggly under the COMMA after barsAgo. The codes
                              doesn't provide enough info on solving the error, have no clue what might be the
                              issue.
                              Any assistance will be highly appreciated.

                              Thanking,
                              Mukaddim
                              Last edited by Mukaddim; 06-20-2018, 08:08 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Barry Milan, Today, 10:35 PM
                              2 responses
                              8 views
                              0 likes
                              Last Post Barry Milan  
                              Started by WeyldFalcon, 12-10-2020, 06:48 PM
                              14 responses
                              1,428 views
                              0 likes
                              Last Post Handclap0241  
                              Started by DJ888, Yesterday, 06:09 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              41 views
                              0 likes
                              Last Post jeronymite  
                              Started by bill2023, Today, 08:51 AM
                              2 responses
                              16 views
                              0 likes
                              Last Post bill2023  
                              Working...
                              X