RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Custom Indicator Questions Expand / Collapse
Message
Posted 4/5/2007 00:10:53 Post #1965
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

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 4/5/2007 08:43:31 Post #1977
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
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 4/5/2007 18:44:57 Post #2005
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Hello Bill,

Thanks I will try it out

EK

Posted 4/6/2007 00:04:50 Post #2008
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
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 4/6/2007 05:39:05 Post #2009
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
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 4/8/2007 19:45:37 Post #2052
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
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 4/8/2007 19:58:41 Post #2053
 

Lead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead DeveloperLead Developer
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 4/8/2007 20:20:25 Post #2054
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Hello Bill,

Thank you, now I understand

EK

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:32am

2005-2007 © RightEdge Systems