Profile Picture

Indicator plugin, please help

Posted By henk 8 Years Ago
Message
Posted Monday September 21 2009
I copied the code and followed the instructions in the RE helpfile re "Creating an Indicator". In C# I get the following error messages. Please help.

Reference added to RightEdge.Common:

Posted Tuesday September 22 2009
The error message states that a reference to System.Drawing is missing. Please add that reference. Also, you appear to be missing a using statement to include System.Collections. Add that as well.

henk (9/21/2009)
I copied the code and followed the instructionsin the REhelpfile re "Creating an Indicator". In C# I get the following error messages. Please help.



Reference added to RightEdge.Common:

Posted Tuesday September 29 2009
I have added the reference to System.Drawing and added 'using System.Collections;'

I now find the following errors:

Warning   1   The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files\Yye Software\RightEdge 2008 Edition 1\Common.dll'   my1stindicator


Error   2   Using the generic type 'System.Collections.Generic.List' requires '1' type arguments   C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\my1stindicator\Class1.cs   40   25   my1stindicator

What to do?
Posted Tuesday September 29 2009
The warning can be ignored. I don't have enough information to diagnose the error. Can you post the line of code that's generating this error?

henk (9/29/2009)
I have added the reference to System.Drawing and added 'using System.Collections;'

I now find the following errors:

Warning   1   The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files\Yye Software\RightEdge 2008 Edition 1\Common .dll'   my1stindicator


Error   2   Using the generic type 'System.Collections.Generic.List' requires '1' type arguments   C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\my1stindicator\Class1.cs   40   25   my1stindicator

What to do?
Posted Tuesday September 29 2009
relevant sections of code:

using System.Collections.Generic;

public override List CalcSeriesValues(IList bars)
Posted Wednesday September 30 2009
OK, the List is a list of doubles, so

public override List CalcSeriesValues(IList bars)

should do the trick.

henk (9/29/2009)
relevant sections of code:

using System.Collections.Generic;

public override List CalcSeriesValues(IList bars)
Posted Wednesday September 30 2009
You are loosing me. That is exactly the code I have?
Posted Thursday October 01 2009
It looks like the forum software stripped off the greater than / less than symbols and everything in between. I responded to your email.

henk (9/30/2009)
You are loosing me. That is exactly the code I have?
Posted Monday June 27 2011
Hello,



does the trick.

Pawel

Edited: Monday June 27 2011 by vanSant
Posted Sunday July 24 2011
I'm getting a similar error, and it's while copy-pasting from the help file on indicator creation. A couple of questions:

does List get changed to RList in both places? Did the "R" get stripped off by some formatting error?

Also, I'm getting a build error that reads as follows, and it relates to the :base(true) line.


Error   1   'RightEdge.Common.IndicatorBase' does not contain a constructor that takes 1 arguments   C:\Users\Win7Home\AppData\Local\Temporary Projects\ClassLibrary1\Class1.cs   26   15   ClassLibrary1


public AveragePriceSample()
: base(true)




Below is the indicator implemented. You can paste the contents right into your environment.



C#

using System;

using System.Collections.Generic;

using System.Text;

using System.Drawing;

using RightEdge.Common;

namespace MyIndicator

{

[YYEIndicatorAttribute(System.Drawing.KnownColor.Black,

YYEIndicatorAttribute.EIndicatorGroup.Trend,

Name = "Average Price Indicator",

Description = "An average of the bar's high, low and closing prices",

Id = "{BE86C408-99C2-45bf-BC21-45D2B8623AD0}",

HelpText = "A simple indicator that takes bar data and returns the average of the High, Low and Close values.")]

[Serializable]

public class AveragePriceSample : IndicatorBase

{

public AveragePriceSample()

: base(true)

{

}

public override List CalcSeriesValues(IList bars)

{

return base.CalcSeriesValues(bars);

}

public override double CalcNextValue(BarData bar)

{

if (bar.EmptyBar)

{

return double.NaN;

}

return (bar.High + bar.Low + bar.Close) / 3.0;

}

}

}



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems