![]() |
|
|||||||
| NinjaScript File Sharing Discussion Discussion for shared NinjaScript files. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Alligator and Gator Oscillator by Bill Williams
![]() Usage: http://www.metaquotes.net/techanalys...ors/alligator/ Syntax Code:
Alligator() Gator() Code:
Alligator().Jaw[int barsAgo] Alligator().Teeth[int barsAgo] Alligator().Lips[int barsAgo] Code:
Gator().JawTeeth[int barsAgo] Gator().LipsTeeth[int barsAgo] In the middle of http://www.adblue.de/cqg/movings.htm discusses the calculations of the SMMA. As always, please let me know if you see any bugs/miscalculations or have suggestions/comments. Thank you. Bug Fix: Fixed an error on SMMA when used with CalculateOnBarClose = false.
Last edited by NinjaTrader_Josh; 03-28-2008 at 04:03 PM.
|
|
|
|
|
|
#2 |
|
Member
Join Date: May 2006
Location: , , United Kingdom
Posts: 88
Thanks: 0
Thanked 0 times in 0 posts
|
Uacvx, this is awesome stuff, your efforts are really appreciated.
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2007
Posts: 77
Thanks: 3
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
There has been a bug fix to this indicator. If you are using it please update.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Jun 2007
Posts: 77
Thanks: 3
Thanked 0 times in 0 posts
|
Thank you so much Josh, I do use the alligator!
|
|
|
|
|
|
#6 |
|
Certified NinjaScript Consultant
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
|
Hi everyone,
I found an issue with the Gator Oscillator...most histo bars were green when this was running in real-time. If you've experienced this problem, I've attached the fix to this post. Enjoy! Ben |
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Thanks for the fix Ben.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
|
Hello there,
I am considering switching over to NT from Sierra Charts and have played around with the Alligator indicators on both platforms. There appears to be a discrepancy in the way the indicators are plotted and I am wondering whether or not it could be due to the offsets in the code. Attached are JPEGS of the indicators working on both platforms -- as you can see, the shapes of the lines are almost identical. However, the vertical offset seems to be different --> but which chart is correct? Is it possible that different sums are being used as well? I have checked with SC and they are using the following formula: +++++++++++++++++++++++ Smooth: A Smoothed Moving Average is similar to a simple moving average. However, in a smoothed moving average, rather than subtracting the oldest value the previous smoothed average value is subtracted. For the following example the PERIOD equals 3. The first value for a Smoothed Moving Average is determined by the formula SMOOTH. It is plotted on the chart at the third bar from the left side of the screen. SMOOTH =(PRICE 1 + PRICE 2 + PRICE 3)/PERIOD The next value would be plotted at the fourth bar from the left side of the screen. SMOOTH2 = (PREVIOUS SUM - PREVIOUS AVG + PRICE 4)/PERIOD For the second calculation of SMOOTH, PREVIOUS SUM is the sum of PRICE 1 + PRICE 2 + PRICE 3; and PREVIOUS AVG is the initial value of SMOOTH. The next value would be plotted at the fifth bar from the left side of the screen. SMOOTH = (PREVIOUS SUM - PREVIOUS AVG + PRICE 5)/PERIOD. Subsequent values would be determined by subtracting the PREVIOUS AVG from the PREVIOUS SUM, adding the next more recent PRICE, then dividing by the PERIOD. ++++++++++++++++++++++++ Thanks. Warmest regards, Andrew |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Hi achung,
From the screenshots you may be using an older version of the indicator which had a bug in regards to converging plots in live data. Please try updating and seeing if that helps. Other than that, the SMMA implementation should be the same as you described.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multicolor Indicator that is Not an Oscillator | MJT | Indicator Development | 4 | 01-15-2009 07:10 AM |
| Elliott Oscillator | PrTester | NinjaScript File Sharing Discussion | 2 | 09-18-2007 05:25 AM |