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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          154 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          306 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          345 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          176 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X