Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No overload for method

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

    No overload for method

    I'm getting the Error "No overload for method '_KenEma7' takes '0' arguments. I looked up the 1501 error but I don't get it? Can you help?
    protectedoverridevoid Initialize()
    {
    SetProfitTarget(
    "", CalculationMode.Ticks, ProfitTarget);
    SetStopLoss(
    "", CalculationMode.Ticks, StopLoss, false);
    Add(_KenEma7());<-----This is the problem

    #2
    Hello kenb2004,

    This means your indicator is expecting at least one parameter here. To see the intellisense help for your indicator, type:
    _KenEma7(

    It should then display overloads here. The overloads are automatically generated based on public inputs in your indicator.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I sorry type: _KenEma7( where?

      Comment


        #4
        You should be able to type it anywhere. It's the first open parentheses that prompts the intellisense help.

        You can also edit the indicator, and locate all needed public inputs there.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I put a (1) in the empty () and the error went away. Does that mean the Strategy is looking for the indicator's 1 public input? If the indicator has 10 public inputs does this number need to be 10 (10)?

          Comment


            #6
            Hi Ken,

            No, the 1 here is likely a valid input for the default myInput0 that is populated when you create the indicator.

            If your indicator has 10 public inputs, then you need to specify a value for all 10, separated by a comma.

            myInd (1, 2, 3, "someString", true, 4.4, "anotherString", false, 9, 86)

            You can alsp plug in directly the variable name for the input here.

            Add(_KenEMA7(MyInput0));
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              OK I put in all the missing parameters and I got a "type expected" error with the last ")" highlighted. Can you tell me how to fix this error?
              Add(_KenDoubleMA(20, 7, NinjaTrader.Indicator.MAV.MAType.EMA, NinjaTrader.Indicator.MAV.MAType.SMA, true, 5, -2, true, new));

              Comment


                #8
                Hi Ken,

                This likely has to do with your new keyword. What is the last parameter expected there?
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  private ArrayList data = new ArrayList();


                  #region Variables
                  // Wizard generated variables
                  private int mA2Period = 20; // Default setting for HMAPeriod
                  private int mA1Period = 7; // Default setting for MAPeriod
                  private NinjaTrader.Indicator.MAV.MAType mA1Type = NinjaTrader.Indicator.MAV.MAType.EMA;
                  private NinjaTrader.Indicator.MAV.MAType mA2Type = NinjaTrader.Indicator.MAV.MAType.SMA;
                  private Color risingColor;
                  private Color fallingColor;
                  private bool showArrows = true;
                  private int arrowDisplacement = 5;
                  // User defined variables (add any user defined variables below)
                  private int direction;
                  private int lastDirection;
                  private int lastCalcBar = -2;
                  private bool drawObjects = true;
                  private ArrayList data = new ArrayList();
                  private BoolSeries bearIndication;
                  private BoolSeries bullIndication;
                  private double exposedVariable;
                  private int decimals;
                  #endregion
                  Last edited by kenb2004; 09-22-2010, 06:40 PM.

                  Comment


                    #10
                    Ken, I think the int decimals might be missing here? To make sure what exactly is missing you would need to go through the overload with Intellisense's help as it would point out the expected parameters then.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    574 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X