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

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 martin70, 03-24-2023, 04:58 AM
          15 responses
          114 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by The_Sec, Today, 02:29 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by jeronymite, 04-12-2024, 04:26 PM
          2 responses
          31 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by Mindset, 05-06-2023, 09:03 PM
          10 responses
          265 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by michi08, 10-05-2018, 09:31 AM
          5 responses
          743 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X