Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

passing the indicator reference to an add-on

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

    passing the indicator reference to an add-on

    Hi,

    In order to create a library where i could abstract functionality, I passed the indicator reference from my indicator and was able to create series in the add-on successfully...

    Here is code that does work (for the constructor):

    Code:
      public Belt(Indicator Indicator)
    
            {
                this.Indicator = Indicator;
                MAShort = new Series<double>(Indicator);
                MAMedium = new Series<double>(Indicator);
           }
    However, if I want to have my custom Market Analyzer script use this, it doesnt have an indicator reference to pass, so I am stuck....

    What can I do to work around this problem?

    #2
    To clarify, I have classes that I put into an Addon, and I want to use this logic in Indicators, custom columns, and strategies... I am guessing that I might need to use ninjaScriptBase or something ,I just dont know how to do this...

    Comment


      #3
      Hello KhaosTrader,

      The Market Analyzer column is not an indicator so you will not be able to pass an indicator in this way.

      But you could pass a MarketAnalyzerColumn if you had a MarketAnalyzerColumn class property in the Addon instead of an indicator.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        I can create a series in an custom column however i cant generalize by cast to the addoon to an indicator and a a custom column.. So I ask you what abstract casting can i use to instantiate a series in an add-on by passing a ninjascriptbase from an indicator, custom column, and strategy.
        Last edited by KhaosTrader; 09-23-2016, 01:54 PM.

        Comment


          #5
          Hello KhaosTrader,

          I'm not aware there is a way to cast an MarketAnalyzerColumn as an indicator or strategy or vice versa.

          This is why I am recommending you make a MarketAnalyzerColumn property in the Addon and set your column instance to that property.

          You can trying using the NinjaScriptBase class though I am not certain that will achieve your goal.

          This thread will remain open for any community members that are aware of a way to do this.

          You can also contact one of our professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I am asking for the opposite, how do i cast such that an indicator, strategy,or column, can call an addon where the add-on can create a series variable type.. I pass Indicator for indicator, but I need a more generalized abstracted cast such that i can have the add-on create the series when instantiated from a non-indicator, such as a strategy or custom column...

            Please help me figure out a solution for this.

            Comment


              #7
              KhaosTrader,

              If you were to create a property for Indicator, MarketAnalyzerColumn, or Strategy, and then check to see which is not null in the addon, you would need to cast anything.

              I am not aware that there is a way to accomplish what you are trying to achieve.

              This thread will remain open for any community members that would like to assist.

              Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                I figured it out, just do a cast of ninjascriptbase, and that works...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by xiinteractive, 04-09-2024, 08:08 AM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by Johnny Santiago, 10-11-2019, 09:21 AM
                95 responses
                6,193 views
                0 likes
                Last Post xiinteractive  
                Started by Irukandji, Today, 09:34 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by RubenCazorla, Today, 09:07 AM
                1 response
                6 views
                0 likes
                Last Post RubenCazorla  
                Started by TraderBCL, Today, 04:38 AM
                3 responses
                26 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X