Indicator Development Support for the development of custom indicators using NinjaScript.

 11-20-2008, 10:52 PM #1 Drakmyre Senior Member   Join Date: Jan 2008 Posts: 103 Thanks: 0 Thanked 0 times in 0 posts Elliptic Oscillator. Hey Everyone, There is an Elliptic Filter posted in the download section. In the accompanying documents there is an explanation of the filter. The author(Ehlers) talks of an oscillator. I'll provide the code he gives but beyond that, I don't know what to do to get the two lines he uses. Smooth = .13785*Price + .0007*Price[1] + .13785*Price[2] + 1.2103*Smooth[1] - .4867*Smooth[2]; Inputs: Price((H+L)/2); Vars: Detrend(0); Value1 = Price + .088*Value1[6]; Value2 = Value1 – Value1[6] + 1.2*Value2[6] - .7*Value2[12]; Detrend = Value2[12] – 2*Value2[6] + Value2; Plot1(Detrend, “Detrend”); Smooth = .13785*(2*Price – Price[1]) + .0007*(2*Price[1] – Price[2]) + .13785*(2*Price[2] –Price[3]) + 1.2103*Smooth[1] - .4867*Smooth[2] The first is the Elliptic filter. The second is the Detrend formula and the third is the Modified Elliptic filter.
 11-21-2008, 12:54 AM #2 NinjaTrader_Dierk Administrator     Join Date: Mar 2005 Location: Bamberg, Germany Posts: 9,994 Thanks: 0 Thanked 6 times in 6 posts May be the community wanted to provide some support to convert this indicator to NinjaScript... Dierk NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 11-21-2008, 07:07 AM #3 Elliott Wave Senior Member   Join Date: Mar 2008 Posts: 731 Thanks: 0 Thanked 1 time in 1 post I converted the MEF, if that is what you are referring to. If you have a link with more info on the oscillator I'll check it out and see if it can easily be converted as well.
11-21-2008, 09:08 PM   #4
Drakmyre
Senior Member

Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Response.

Hey EW,

Here you go. It's the link to where I got everything.

Quote:
 Originally Posted by Elliott Wave I converted the MEF, if that is what you are referring to. If you have a link with more info on the oscillator I'll check it out and see if it can easily be converted as well.

 01-05-2009, 02:47 PM #5 clfield Member   Join Date: Sep 2008 Posts: 68 Thanks: 0 Thanked 0 times in 0 posts Detrending Oscillator Hi, I am wondering if anyone has written an indicator based on the formulas in the article by John Ehlers ? It looks promising in the article.
 01-05-2009, 02:50 PM #6 NinjaTrader_Josh NinjaTrader Product Manager     Join Date: May 2007 Location: Denver, CO Posts: 17,458 Thanks: 1 Thanked 106 times in 70 posts All indicators available are generally located in the File Sharing section of the forums. Please try searching there. Josh NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 01-05-2009, 05:02 PM #7 clfield Member   Join Date: Sep 2008 Posts: 68 Thanks: 0 Thanked 0 times in 0 posts I Looked there but did not find anything that matches the code in this thread. I made an attemp at coding this...the results are not quite what I expected. I am copying the main code to see if anyone has any ideas. protected override void Initialize() { Add(new Plot(Color.Green, "Detrend")); Add(new Plot(Color.Orange, "Avg")); Add(new Line(Color.LightGray, 0, "Zero")); Add(new Line(Color.YellowGreen, 80, "Upper")); Value1 = new DataSeries(this); Value2 = new DataSeries(this); } /// /// Calculates the indicator value(s) at the current index. /// protected override void OnBarUpdate() { Print("Time"+ Time[0]); Print("CurrentBar="+ CurrentBar); if( CurrentBar < 7) { /*for (int i=1; i<7;i++) Value1.Set(Median[0] + 0.88*Median[i]); //Print("i="+ i); */ Value1.Set(Median[0] + 0.88*Median[CurrentBar]); Print("Value1="+ Value1[0]); } else if(CurrentBar < 13) { //for(int i = 6; i < 13 ; i++) { Value1.Set(Median[0] + 0.88*Value1[6]); Value2.Set(Value1[0] - Value1[6] + 1.2*Value2[6] - .7*Value1[CurrentBar]); //Print("i="+ i); Print("VAlue1[0]="+Value1[0]); Print("Value2[0]="+Value2[0]); } } else if (CurrentBar > 13) { Value1.Set(Median[0] + 0.88* Value1[6]); Value2.Set(Value1[0] - Value1[6] + 1.2*Value2[6]-0.7*Value2[12]); Detrend.Set(Value2[12] - 2*Value1[6] + Value2[0]); Avg.Set(ModifiedOptimumEllipticFilter(Detrend)[0]); } } #region Properties /// /// Gets the Detrend value. /// [Browsable(false)] [XmlIgnore()] public DataSeries Detrend { get { return Values[0]; } } /// /// Gets the Avg value. /// [Browsable(false)] [XmlIgnore()] public DataSeries Avg { get { return Values[1]; } } /// /// #endregion } }
 01-06-2009, 02:59 AM #8 NinjaTrader_Bertrand NinjaTrader Customer Service     Join Date: Sep 2008 Location: Germany Posts: 22,377 Thanks: 252 Thanked 966 times in 949 posts Thanks for posting your code, where do you run into issues with this? Bertrand NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 01-06-2009, 09:17 AM #9 clfield Member   Join Date: Sep 2008 Posts: 68 Thanks: 0 Thanked 0 times in 0 posts It Complies fine and does plot an oscillator. However the oscillator seems to not really follow the price movement and runs in the 145K to 150k range rather than oscillating around the 0 line. It may be something I missed in the formula,,,
 01-06-2009, 09:20 AM #10 NinjaTrader_Josh NinjaTrader Product Manager     Join Date: May 2007 Location: Denver, CO Posts: 17,458 Thanks: 1 Thanked 106 times in 70 posts clfield, Since it is plotting you have it set up properly. You just need to slowly debug your code to figure out the values now. Please take a look at this tip for debugging: http://www.ninjatrader-support2.com/...ead.php?t=3418 Josh NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 01-06-2009, 09:27 AM #11 NinjaTrader_Bertrand NinjaTrader Customer Service     Join Date: Sep 2008 Location: Germany Posts: 22,377 Thanks: 252 Thanked 966 times in 949 posts Upon briefly checking the code, I think there's a small error in this line - Value2.Set(Value1[0] - Value1[6] + 1.2*Value2[6] - .7*Value1[CurrentBar]); should be Value2.Set(Value1[0] - Value1[6] + 1.2*Value2[6] - .7*Value2[CurrentBar]); Maybe this helps. Bertrand NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 01-06-2009, 10:03 AM #12 clfield Member   Join Date: Sep 2008 Posts: 68 Thanks: 0 Thanked 0 times in 0 posts Thanks for Checking the code. I beleive the line you are referring to is contained in the part of the code where i am trying to get the indicator "Started". The formula refers back to previous values of the value being calculated. I figured that I would need to fill those previous cells in the array with something and figure this the best way to do that. I am referring to the first 2 if CurrentBar statements. MAybe someone has a suggestion for a better way to do this "start up" proccess.
 01-06-2009, 10:21 AM #13 NinjaTrader_Josh NinjaTrader Product Manager     Join Date: May 2007 Location: Denver, CO Posts: 17,458 Thanks: 1 Thanked 106 times in 70 posts clfield, I cannot comment on your formulas. You will just need to step through it and figure out how you want to do it. Instead of doing if (CurrentBar < 7) and then doing a loop just do if (CurrentBar == 7) so you only process the loop once. Unfortunately we just do not have the bandwidth to further evaluate your code to see if that will change your calculations. Josh NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News and Announcements     News and Announcements Application Technical Support     ATM Strategies (Discretionary Trading)     Automated Trading     Charting     Connecting     Installation and Licensing     Market Analyzer     Miscellaneous Support         Historical Version 7 Beta Threads             Critical Information - Please review             Version 7 Beta General Questions & Bug Reports         Historical NinjaTrader 6.5 Archive             Historical NinjaTrader 6.5 Beta Threads     Strategy Analyzer     SuperDOM and other Order Entry Windows NinjaScript Development Support     General Programming     Indicator Development     Strategy Development NinjaScript Educational Resources     Reference Samples     Tips NinjaScript File Sharing     NinjaScript File Sharing Discussion     Version 7 Indicators     Version 7 Strategies     Version 7 Miscellaneous Suggestions and Feedback     Suggestions And Feedback

 Similar Threads Thread Thread Starter Forum Replies Last Post T9999 Indicator Development 3 10-02-2012 01:59 PM gerryk Indicator Development 10 06-20-2012 11:35 AM Elliott Wave Indicator Development 8 02-11-2010 02:35 PM jeremymgp Indicator Development 26 11-04-2008 08:41 PM PrTester NinjaScript File Sharing Discussion 2 09-18-2007 05:25 AM

All times are GMT -6. The time now is 08:51 AM.

 -- Fixed Width ---- Fluid Width NinjaTrader Support Forum - Archive - Top