Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
AutoTrendLine and Indicator?
Collapse
X
-
The enum declaration will provide the items available from the drop down list. You don't need to declare additional items in the list for the swing indicator. The list should just be the names of indicators that you would like to support for your indicator. However, when you actually set plots based on the case (which indicator selected), you'll be using different versions of the swing indicator than the standard to construct your indicator.Ryan M.NinjaTrader Customer Service
Comment
-
The drop down selection is only visible for the end user, and then what you actually do with this is determined by what you specify in the case block for that enum selection. As far as the drop down selection goes: Yes, it makes sense to design this so only the indicator name is available.
Play around with the UniversalMovingAverage indicator on a chart to see how this works. User selects EMA, and then the code that gets executed can be seen under the EMA case.Ryan M.NinjaTrader Customer Service
Comment
-
Yep, I get it, but I meant something a little different. Right now, I have two indicators. Swing is setup with the RSI and Trendline calls Swing. Instead of doing that, I was thinking of combining both codes into one indicator and then when you select MACD, I can have a case for plotting the MACD and a case for swing formula so everything's in one. Would that work? I'm thinking that would be a lot easier in the long run.
Comment
-
I see what you're asking now. How you structure the code is really up to you. It may be easier to maintain if they are in separate files, but tradeoff is a little more complicated distribution and more room for dependency errors because of this. A generic swing indicator that you could apply to any series would be good, but we wouldn't be able to tell you exactly how to develop it.Ryan M.NinjaTrader Customer Service
Comment
-
Morning Ryan,
Making good progress here but ran into an issue. The top indicator represents a normal RSI with my TrendLine indicator on top of it. The bottom one is the new combo and, as you can see, doesn't plot correctly. While the trendline matches up perfectly, the RSI plots are obviously off AND the orange line shouldn't even be plotting as I have it set to smooth 1. I'm a little stuck here. Does anything pop out for you?
Thanks,
Dave
Comment
-
Ryan,
I'm getting nowhere fast. Since it starts plotting correctly eventually, I'm guessing it's a DataSeries issue. Would this line in my Variables be causing the problem?:
private IDataSeries Indicator;
Maybe I have to resync each indicator case when called?
PHP Code:protected override void OnBarUpdate()
{
switch(indicatorType)
{
case IndicatorMethod.RSI:
InitRSI();
Indicator = RSI(Close, Period, Smooth);
break;
case IndicatorMethod.MACD:
InitMACD();
Indicator = MACD(Fast, Slow, Smooth);
break;
}
---------------------------------------------------------------------------------------------------------------------
private void InitRSI()
{
Add(new Plot(Color.Green, "RSI"));
Add(new Plot(Color.Orange, "Avg"));
Add(new Line(System.Drawing.Color.DarkViolet, 30, "Lower"));
Add(new Line(System.Drawing.Color.YellowGreen, 70, "Upper"));
avgUp = new DataSeries(this);
avgDown = new DataSeries(this);
down = new DataSeries(this);
up = new DataSeries(this);
}
Last edited by dsraider; 07-21-2010, 09:56 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
19 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
45 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment