Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble Calling Indicator Passing Parameter

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

    Trouble Calling Indicator Passing Parameter

    I have created an indicator named PMABP that has a parameter, an enumartion, named Bias. I am trying to call the indicator from another indicator named PMATotals but I am getting an error on compilation indicating that PMAPB wants the parameter to be of type IDataSeries. Why is that and how can I call the PMAPB indicator properly?

    Both indicators are attached.
    Attached Files

    #2
    dkrumholz, you pass the enum selection as a string in the method call, this will not work unfortunately. To see how to implement such a concept I believe you could check into the DoubleMA custom indicator posted on the sharing section.

    Comment


      #3
      Calling Indicator Using Enumeration

      The DoubleMA custom indicator seems to require that the MAV indicator, the called indictor, accept an integer parameter for the moving average type. ChannelThis accepts an enumeration parameter recognizable by the user but MAV doesn't - it accepts an integer. I am trying to have either indicator accept the enumeration so that the user can run either the calling or the called indicator always supplying the same parameter type. Is there a way to do this where both indicators accept a selection from the same enumration and the enumeration is used in the call from one indicator to the other?

      Comment


        #4
        dkrumholz, rechecked your codes and found an issue, the enum should be declared outside the NinjaTrader namespace, please see our fixed version attached, then the enum should be accessible as parameter.
        Attached Files

        Comment


          #5
          Indicator Won't Compile

          The indicator you corrected would not compile. Please see attached screenshot.
          Attached Files

          Comment


            #6
            dkrumholz,

            That is because you cannot define an enum in two locations. Please remove your old definition and only define the enum once across your whole NinjaScript assembly.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Let me remove those referenced indicators -

              I see that the errors refer to old copies of the indicators. Let me remove those and try to recompile. Thanks!

              Comment


                #8
                New Compilation Error

                In PMAPB I am now getting the compilation error "The type or namespace name 'GridCategory' could not be found (are you missing a using directive or an assembly reference?) CS0246."

                Current copies of the two indicators are attached.

                Thanks!!
                Attached Files

                Comment


                  #9
                  Hello,

                  See the link within this link:
                  DenNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

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