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

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([U]AATrendLines[/U] 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!







          -=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 RookieTrader, Today, 09:37 AM
                  3 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by kulwinder73, Today, 10:31 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post kulwinder73  
                  Started by terofs, Yesterday, 04:18 PM
                  1 response
                  24 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by CommonWhale, Today, 09:55 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by Gerik, Today, 09:40 AM
                  2 responses
                  8 views
                  0 likes
                  Last Post Gerik
                  by Gerik
                   
                  Working...
                  X