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

cannot convert from method group

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

    cannot convert from method group

    I'm calling this indicator from a Strategy. I cant get this to compile. I found a similar issue and added :

    using TradingStudies.NinjaScript.Utility; to my Using Declarations,, in my Strategy, did not help

    TSSuperTrend(Median,14,HMA,2.618,14,ATR)

    I get this error message for both: HMA and ATR

    Argument '3': cannot convert from 'method group' to 'TradingStudies.NinjaScript.Utility.MovingAverageT ype' CS1503

    Argument '6': cannot convert from 'method group' to 'TradingStudies.NinjaScript.Utility.SuperTrendMode ' CS1503


    Thanks for your help
    Attached Files
    Last edited by gg80108; 03-07-2010, 04:14 PM.

    #2
    Provided you've added to using the NinjaScript utility to your declarations the snippet below should compile well -

    Code:
     
    double mySuperTrendValue = TSSuperTrend(10, MovingAverageType.SMA, 2, 2, SuperTrendMode.ATR)[0];
    BertrandNinjaTrader Customer Service

    Comment


      #3
      txs,, one more thing

      Now I can do a get for some data,, lots of numbers come back but nothing that makes any sense.. I created my own Data Series and loaded it but it returns mostly 0s. I using the below in my STRATEGY.. The attachment is a picture of whats going on.. The blue circled are in the TSSupertrend indicator, the red 0s come from my strategy..

      double mySuperTrendValue = TSSuperTrend(10, MovingAverageType.SMA, 2, 2, SuperTrendMode.ATR).ArrowValues.Get(CurrentBar);
      DrawText("AM"+ CurrentBar, Convert.ToString(mySuperTrendValue), 0,High[0]+ TickSize *5, Color.Red);

      lines 145 and 168 in TSSupertrend is where I think I am loading my DataSeries. I'm just trying to get some reference of when the arrows are firing or even the level of the indicator would be nice back to my Strategy.

      Txs again
      Don
      Attached Files

      Comment


        #4
        Unfortunately I would not know as I'm not intimately familiar with this add on indicator - if you call this from a strategy try removing any CalculateOnBarClose references in the called indicator and then control / set this only from the calling strategy.

        You could review this strategy code posted here, as it gives easy access to trend changes with an exposed signal series - http://www.ninjatrader-support2.com/...&postcount=220
        BertrandNinjaTrader Customer Service

        Comment


          #5
          all good now

          Thanks for the help and snipits of code.. Just noticed that the parms that I was called the indicator in the Strategy, were different then the parms just adding the indicator to a chart....da... All match now.....

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elirion, Today, 01:36 AM
          0 responses
          3 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          4 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          391 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          34 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Working...
          X