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

How to use imported homemade indicators in another indicator/system ?

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

    How to use imported homemade indicators in another indicator/system ?

    Hi everybody,

    I would like to know how to use an indicator I imported in another indicator. I don't find any key-word to do this but I guess there is one ?

    Thanks a lot !

    After

    #2
    Hello After,

    Thank you for your note.

    Could you please elaborate on what you mean by imported into another Indicator?

    Are there two classes in one script trying to act like two separate indicators?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your answer !

      I imported a supertrend indicator from the member tradr (http://www.ninjatrader.com/support/f...ad.php?t=46818)

      I would like to use it in my indicator without copy/past its code but just by "calling it" thanks to the name of the indicator.

      Comment


        #4
        After,

        You would call it like another indicator within NinjaScript.

        So, like calling SMA(14)[0].
        The 14 is an overload property that needs to be passed through for the Indicators' calculations.

        With the SuperTrend -
        SuperTrend(int lenght, double multiplier, bool showArrows)

        Example -
        Code:
        Print(SuperTrend(5, 2.5, true)[0]);
        Let me know if I can be of further assistance.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Cal !

          But for example if i would like to use this one :


          When I load it from the chart I have to choose :

          Supertrendmode, period, multiplier, ma, smoothingperiod

          Why if I write in my code TSSuperTrend("Adaptive", 8,2,"SMA",14).UpTrend[0] it doesn't work ? How could I know how write the "calling" ?

          thanks very much

          Comment


            #6
            After,

            NinjaScript editor does have a built in Intellisense. When you type your (, this will start the Intellisense. If you don't see it, Ctrl + Shift + Space will bring up Intellisense for the current method/class that you are in with the typing cursor
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Not a bad idea ! Cool

              But for example here I have to load "maType" and another one strange. It doesn't accept "HMA" or a number like 2. How could I do ?

              Thanks
              Attached Files
              Last edited by After; 02-20-2015, 01:42 PM.

              Comment


                #8
                Originally posted by After View Post
                Not a bad idea ! Cool

                But for example here I have to load "maType" and another one strange. It doesn't accept "HMA" or a number like 2. How could I do ?

                Thanks
                Look in the PropertyGrid for valid values, or open the indicator code, and read what values are valid.

                Comment


                  #9
                  Thanks koganam

                  I checked the Supertrend code to find the right function but look at this, I tried different thing but still doesn't work. I guess there is something wrong
                  Attached Files

                  Comment


                    #10
                    Originally posted by After View Post
                    Thanks koganam

                    I checked the Supertrend code to find the right function but look at this, I tried different thing but still doesn't work. I guess there is something wrong
                    Looks like you need a "using" statement for the namespace that holds your primitives, or you need to use the FQPN.

                    Comment


                      #11
                      Hi After

                      Could part of the problem be that you're referring to TSSuperTrend, which may be slightly different from the usual SuperTrend indicator?

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Barry Milan, Today, 10:35 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post Barry Milan  
                      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
                      40 views
                      0 likes
                      Last Post jeronymite  
                      Started by bill2023, Today, 08:51 AM
                      2 responses
                      16 views
                      0 likes
                      Last Post bill2023  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      167 responses
                      2,260 views
                      0 likes
                      Last Post jeronymite  
                      Working...
                      X