Profile Picture

Arguments are not recognised in a c# indicator plugin

Posted By hairy_mug 10 Years Ago
Message
Posted Friday June 01 2007
Following the examples given, I coded my first c# indicator.

It compiles fine but when I d&d it fails and the following message is given:

Inner Exception:
An exception of type System.ArgumentException was thrown.
Need exactly 3 input series, 0 were passed in.
   at RightEdge.Common.SeriesCalculatorBase.SetInputs(ISeries[] newInputs)
   at RightEdge.Common.SeriesCalculatorBaseWithValues.SetInputs(ISeries[] newInputs)
   at RightEdge.Shared.SeriesCalculatorWrapper.SetInputs(ISeries[] inputs)

I use the "ConstructorArgument" to define my args but it does not seem to recognise them...

Thanks for your help,

Walt

The definition code follows:

********************************************************************

using System;

using System.Collections.Generic;

using System.Text;

using RightEdge.Common;

using RightEdge.Indicators;

namespace whisIndicators

{

[YYEIndicatorAttribute(System.Drawing.KnownColor.Crimson,

YYEIndicatorAttribute.EIndicatorGroup.Other,

Name = "peak",

Description = "indicates peak",

Id = "{2fccb6a1-79b0-4a6b-bcaf-26ba2f0ba363}")]

[Serializable]

public class peak : SeriesCalculatorBaseWithValues

{

private int ii_width =3;

private double id_depthPct=.02;

private int ii_skew=0;

private int ii_pbarIndex=0;

[ConstructorArgument("Width", ConstructorArgumentType.Integer, "5", 1)]

[ConstructorArgument("DepthPct", ConstructorArgumentType.Double, "0.02", 2)]

[ConstructorArgument("Skew", ConstructorArgumentType.Integer, "0", 3)]

public peak(int ai_width, double ad_depthPct,int ai_skew): base(3)

{

this.ii_width = ai_width;

this.ii_skew = ai_skew;

this.id_depthPct = ad_depthPct;

}

 

Posted Saturday June 02 2007
here is the answer to my own question:

The argument for the base constructor must be the number of Series that the user is prompted for:

        public peak(int Width, double DepthPct, int Skew) : base(1)

Not (as I first thought) the number of arguments specified by the "ConstructorArgument"....

AND, most important, a series input specifier:

          [SeriesInputAttribute("Input", 1)]

Also, (I am not sure about this), the argument names in the constructor should match the names given in the "ConstructorArgument" statements? (like I said not sure about this)...

In any case, It Works!!

>> The more I work with RightEdge the more it impresses me; Just have to get the hang of it...

Walt 

BTW; The c# example "SeriesCalculatorBaseWithValues" needs the

"[SeriesInputAttribute("Input", 1)]"   line added...

Posted Saturday June 02 2007
Yes, thanks for bringing this to our attention.  It will be fixed for the next build.

hairy_mug (6/2/2007)
here is the answer to my own question:

The argument for the base constructor must be the number of Series that the user is prompted for:

        public peak(int Width, double DepthPct, int Skew) : base(1)

Not (as I first thought) the number of arguments specified by the "ConstructorArgument"....

AND, most important, a series input specifier:

          [SeriesInputAttribute("Input", 1)]

Also, (I am not sure about this), the argument names in the constructor should match the names given in the "ConstructorArgument" statements? (like I said not sure about this)...

In any case, It Works!!

Thank you, we like to hear that!

>> The more I work with RightEdge the more it impresses me; Just have to get the hang of it...

Walt 

BTW; The c# example "SeriesCalculatorBaseWithValues" needs the

"[SeriesInputAttribute("Input", 1)]"   line added...



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems