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 Question

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

    Coding Question

    I cant get this to compile. It looks right to me and those are the correct settings on the indicator.

    && TrendStrengthA(Close,EMA,100,5,5)[0]> 60)

    I also tried this:

    && TrendStrengthA(Close,EMA,100,5,5).TrendStrength[0]< 50)
    I get this error message for both:
    The best overloaded method match for 'NinjaTrader.Indicator.Indicator.TrendStrengthA(Ni njaTrader.Data.IDataSeries, VC.NinjaScript.Utility.MovingAverageType, int, int, int)' has some invalid arguments CS1502

    Argument '2': cannot convert from 'method group' to 'VC.NinjaScript.Utility.MovingAverageType' CS1503

    Thanks for your help

    #2
    Try substituting EMA with

    Code:
    NinjaTrader.Indicator.MAV.MAType.EMA
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      That didnt work either, but thanks for the imput.
      Much appreciated, mrlogik.

      Comment


        #4
        Hi dwalls,

        Can you please post your code for the TrendStrengthA, then I can take a look...Thanks!
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks NinjaTrader_Bertrand.
          Attached is the code for the TrendStrenghtA indicator, I just downloaded it from the Indicators section of this forum.
          Here is a sample of what I am trying to code:

          if (CurrentBar < 5)
          return;
          if (CrossAbove(EMA(Close,5), EMA(Close,20), 1)
          && TrendStrengthA (Close,EMA,100,5,5)[1]> 60)

          But the second line wont compile.

          Thanks
          Attached Files

          Comment


            #6
            Try this and let me know (I don't have NT w/ me now to test)

            Code:
            TrendStrengthA(Close, MovingAverageType.EMA, 100, 5, 5).TrendStrength[0]
            mrlogik
            NinjaTrader Ecosystem Vendor - Purelogik Trading

            Comment


              #7
              Thanks mrlogik.
              I did try that and I get this error message:

              The name 'MovingAverageType' does not exist in the current context CS0103.

              Thanks

              Comment


                #8
                At the top of your file where you see the "using" lines, add this

                Code:
                using VC.NinjaScript.Utility;
                Sorry, its hard to try things out without NT on this computer.
                mrlogik
                NinjaTrader Ecosystem Vendor - Purelogik Trading

                Comment


                  #9
                  That worked. Thanks mrlogik.
                  Not bad for no NT.

                  What does that "using VC.NinjaScript.Utility;" do?

                  Thanks for your help.

                  Comment


                    #10
                    Its a namespace that defines different enums for use within the TrendStrengthA indicator.

                    The MovingAverageType type is defined from within this namespace.

                    Anywhere you want to use the TrendStrengthA indicator, you will need to add that include at the top of the file.
                    mrlogik
                    NinjaTrader Ecosystem Vendor - Purelogik Trading

                    Comment


                      #11
                      Thank you for your posts and help to our users mrlogik!
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        :-)

                        My pleasure.
                        mrlogik
                        NinjaTrader Ecosystem Vendor - Purelogik Trading

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by DayTradingDEMON, Today, 09:28 AM
                        3 responses
                        19 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by Stanfillirenfro, Today, 07:23 AM
                        9 responses
                        23 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by George21, Today, 10:07 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post George21  
                        Started by navyguy06, Today, 09:28 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by cmtjoancolmenero, Yesterday, 03:58 PM
                        8 responses
                        33 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Working...
                        X