• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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#.
    https://ninjatrader.com/support/foru...040#post786040
    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 mbcmbc, Yesterday, 11:01 PM
          0 responses
          1 view
          0 likes
          Last Post mbcmbc
          by mbcmbc
           
          Started by morrnel, Yesterday, 09:39 PM
          0 responses
          1 view
          0 likes
          Last Post morrnel
          by morrnel
           
          Started by Thesuccesfulinvestor, Yesterday, 09:07 PM
          0 responses
          6 views
          0 likes
          Last Post Thesuccesfulinvestor  
          Started by WestonMicah, Yesterday, 12:44 AM
          1 response
          17 views
          0 likes
          Last Post koganam
          by koganam
           
          Started by xmanjames, Yesterday, 04:22 PM
          0 responses
          11 views
          0 likes
          Last Post xmanjames  
          Working...
          X