• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cloning NT8 TrendLines indicator -- need help

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

    Cloning NT8 TrendLines indicator -- need help

    Hello,

    I want to clone the NT8 TrendLines indicator and make some changes to it...

    After I save this indicator to a AATrendLines then try to compile it....I get these errors

    ---------------------------------------------------------------------------------------------------------------------------------------------------

    The best overloaded method match for 'NinjaTrader.NinjaScript.Indicators.AATrendLines.T rendQueue.TrendQueue(NinjaTrader.NinjaScript.Indic ators.TrendLines, int)' has some invalid arguments

    Argument 1: cannot convert from 'NinjaTrader.NinjaScript.Indicators.AATrendLines' to 'NinjaTrader.NinjaScript.Indicators.TrendLines'

    ---------------------------------------------------------------------------------------------------------------------------------------------------

    on this statement in OnStateChanged

    trendLines = new TrendQueue(this, NumberOfTrendLines);


    It seems this is a scope issue with Public ?

    But, I'm not sure how to fix it...

    ????

    Thanks

    #2
    Hello vantojo, thanks for your note.

    TrendLines has a class in it called TrendQueue. Change the constructor of that class to this and the compile error will clear:

    Code:
    private class TrendQueue : Queue<TrendRay>
    {
    
        ...
        public TrendQueue(AATrendLines instance, int capacity) : base(capacity)
                {
                    this.instance = instance;
                }
    
    }
    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Perfect!

      Thanks

      Comment


        #4
        Hello,

        I thought I had this fixed but when I revisited the indicator, I get this message
        AATrendLines.cs Cannot implicitly convert type 'NinjaTrader.NinjaScript.Indicators.AATrendLines' to 'NinjaTrader.NinjaScript.Indicators.TrendLines'
        I've attached the code...

        Thank you
        Attached Files

        Comment


          #5
          Originally posted by vantojo View Post
          I thought I had this fixed but when I revisited the indicator, I get this message

          Couple months ago now, I posted a modified version at the link below:
          You might take a look at that, or even use it for your base.. Good Luck!

          https://ninjatrader.com/support/foru...09#post1056709





          -=Edge=-
          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

          Comment


            #6
            Thanks, will test it soon....

            Comment


              #7
              would still like to fix the one I posted above....I don't need to manually move the lines....

              Comment


                #8
                Hi vantojo, thanks for your reply.

                The TrendQueue class has an instance property, change that to reflect your change to the indicator class.

                Code:
                private class TrendQueue : Queue<TrendRay>
                        {
                            // Old: private TrendLines    instance;
                            private AATrendLines    instance;
                ...
                Kind regards.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  ok, that compiled now....thank you Chris

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by MarkaAllgood, Today, 01:17 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post MarkaAllgood  
                  Started by assik, Today, 01:00 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post assik
                  by assik
                   
                  Started by manueldecastro, Yesterday, 11:55 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post manueldecastro  
                  Started by ntbone, 07-13-2019, 11:37 PM
                  10 responses
                  28 views
                  0 likes
                  Last Post ntbone
                  by ntbone
                   
                  Started by nicknamed, Yesterday, 05:10 PM
                  1 response
                  17 views
                  0 likes
                  Last Post NinjaTrader_EricB  
                  Working...
                  X