Profile Picture

Custom Indicator Questions

Posted By Emerald King 10 Years Ago
Message
Posted Thursday April 05 2007

I have loaded up the VB.Net Sample SeriesCalculatorBaseWithValuesIndicator

Complied and copied it over to the plugin directory and restarted RE, when I add it to a chart it throws an execption.

Now when I add this line

<SeriesInputAttribute(Name:="Input", Order:=1, Value:=BarElement.Close)> _

It works just fine. I understand that when I add this line to the code it is telling RE to allow the user to select what type of Series to use. How can I get that sample to work without allowing the user to select which Series to use?

 

Next question, what is the best way to implement this type of smoothed SMA within a custom indicator dll?

 

Sum = SSMA[Index+1] * (MA_Length-1) + Close[Index];

SSMA[Index] = Sum/MA_Length);

 

Thank you for your Time

EK

Posted Thursday April 05 2007
If you don't want them to have to select a series, you'd want to look at the IndicatorBase derived sample.  It doesn't take any inputs (it always uses the closing price).

However, based on your second question, we have a bit of a chicken and egg problem.  The way we support "smoothing" or what we call "chaining" requires/allows the user to specify the series (closing price, another indicator series, a custom series, etc).  If you wanted to smooth something without user input, let's say you wanted an SMA of an SMA, I would use the SeriesCalculatorBaseWithValues.  You can store state here so you can create an instance of SMA1 and when you have enough bars to calc SMA2 you can refer back to SMA1 to calc SMA2.  The Reset() function is notification for you to flush any cached calculations you may have.

Does that sound like it might work?

Emerald King (4/5/2007)

I have loaded up the VB.Net Sample SeriesCalculatorBaseWithValuesIndicator

Complied and copied it over to the plugin directory and restarted RE, when I add it to a chart it throws an execption.

Now when I add this line

<SeriesInputAttribute(Name:="Input", Order:=1, Value:=BarElement.Close)> _

It works just fine. I understand that when I add this line to the code it is telling RE to allow the user to select what type of Series to use. How can I get that sample to work without allowing the user to select which Series to use?

 

Next question, what is the best way to implement this type of smoothed SMA within a custom indicator dll?

 

Sum = SSMA[Index+1] * (MA_Length-1) + Close[Index];

SSMA[Index] = Sum/MA_Length);

 

Thank you for your Time

EK

Posted Thursday April 05 2007
Hello Bill,

Thanks I will try it out

EK

Posted Friday April 06 2007
Hello Everyone,

I have a New question.

if I do this

Private MyOM As SystemData

and in my New Sub I do this

Me.MyOM = New SystemData

MyOM.Output.Add(OutputSeverityLevel.Informational, "New Indicator Created")

Will this be displayed in the output plane when I drop this indicator on a Chart?

THanks

EK

Posted Friday April 06 2007
I don't think so.  You should never really create your own instance of SystemData.  This is something RE sets up (based on the trading system project/settings/etc) and passes to you.  It only knows of its own instance, not one you would create.

Emerald King (4/6/2007)
Hello Everyone,

I have a New question.

if I do this

Private MyOM As SystemData

and in my New Sub I do this

Me.MyOM = New SystemData

MyOM.Output.Add(OutputSeverityLevel.Informational, "New Indicator Created")

Will this be displayed in the output plane when I drop this indicator on a Chart?

THanks

EK

Posted Sunday April 08 2007
Hello Everyone,

I have been able to output debuging info from within RE but I havent been able to output anything from my custom indicator using SystemData.Output.Add

Can anyone provide a quck code snippet in vb.net

Thanks

EK

Posted Sunday April 08 2007
You can't add to the output pane from an indicator.  This is for systems only.  For your custom indicator, I recommend using the Trace stuff built into .NET.

Emerald King (4/8/2007)
Hello Everyone,

I have been able to output debuging info from within RE but I havent been able to output anything from my custom indicator using SystemData.Output.Add

Can anyone provide a quck code snippet in vb.net

Thanks

EK

Posted Sunday April 08 2007
Hello Bill,

Thank you, now I understand

EK



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems