Announcement

Collapse
No announcement yet.

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];

    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

        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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          345 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X