Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MedianActivator Data Type

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

    MedianActivator Data Type

    Hello,

    I am attempting to learn ninjascript and develop some strategies for my trading. In looking at a indicator that I am trying to use in a strategy I came across the
    data type MedianActivator, at least I think it is a data type. I cannot find any documentation on this can someone point me to where it is.

    The line of code in the indicator I am looking at is

    private MedianActivator MarkAct;

    I will probably have lots of questions coming as I hope onto this path thanks in advance for the support.

    Mark

    #2
    Hello markbb10,

    If the script is an indicator the class type will be the name of the indicator.

    What you have appears correct to declare a variable of that type.

    private MedianActivator MarkAct;

    The indicator needs to be called in OnStateChange() when State is State.DataLoaded to instantiate an instance and this can be assigned to your variable.

    else if (State == State.DataLoaded)
    {
    MarkAct = MedianActivator(/* any parameters here */);
    }

    Then the properties and series can be used from the object assigned to the variable in OnBarUpdate().

    Print(MarkAct[0]);
    or
    Print(MarkAct.CustomPlot[0]);

    I recommend using the strategy builder to call this indicator and viewing the code.

    Below is a link to a forum post with some helpful information about getting started with NinjaScript and C#.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea, I will give that a try. I do not see an indicator call MedianActivator but will look a little deeper into it. Appreciate the help.

      Mark

      Comment


        #4
        Hello Mark,

        This was the suggested indicator name in post #1.

        If the indicator is not named MedianActivator, what is the indicator name?

        Can you further clarify your mention of MedianActivator in post #1?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea, yes I did, this is code that I am using as a sample to learn and I did not know it was an indicator or that it could be defined that way. I did find it and have
          a much clearer understanding now.. Thanks for your help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          598 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 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
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          555 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X