NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 08-09-2007, 11:24 PM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default Alligator and Gator Oscillator

Alligator and Gator Oscillator by Bill Williams


Usage: http://www.metaquotes.net/techanalys...ors/alligator/

Syntax
Code:
Alligator()
Gator()
To get the value of the various Alligator lines:
Code:
Alligator().Jaw[int barsAgo]
Alligator().Teeth[int barsAgo]
Alligator().Lips[int barsAgo]
To get the Gator bar values:
Code:
Gator().JawTeeth[int barsAgo]
Gator().LipsTeeth[int barsAgo]
Also included in the package is an indicator for SMMA (Smoothed Moving Average).
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.
Attached Files
File Type: zip Alligator_Gator_v0.1.0.zip (6.4 KB, 307 views)
File Type: zip Alligator_Gator_v0.1.1.zip (6.6 KB, 369 views)
Last edited by NinjaTrader_Josh; 03-28-2008 at 04:03 PM.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-10-2007, 01:46 AM   #2
rally
Member
 
Join Date: May 2006
Location: , , United Kingdom
Posts: 88
Thanks: 0
Thanked 0 times in 0 posts
Default

Uacvx, this is awesome stuff, your efforts are really appreciated.
rally is offline  
Reply With Quote
Old 02-22-2008, 07:04 PM   #3
Pipqueen
Member
 
Join Date: Jun 2007
Posts: 77
Thanks: 3
Thanked 0 times in 0 posts
Thumbs up Thank you! I Love it!

Quote:
Originally Posted by rally View Post
Uacvx, this is awesome stuff, your efforts are really appreciated.
Love the indicator and the alligator explanation. THank you so much for sharing!
Pipqueen is offline  
Reply With Quote
Old 03-28-2008, 04:03 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

There has been a bug fix to this indicator. If you are using it please update.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-29-2008, 09:41 AM   #5
Pipqueen
Member
 
Join Date: Jun 2007
Posts: 77
Thanks: 3
Thanked 0 times in 0 posts
Default

Thank you so much Josh, I do use the alligator!
Pipqueen is offline  
Reply With Quote
Old 04-03-2008, 06:40 AM   #6
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default

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
Attached Files
File Type: zip Gator.zip (6.6 KB, 285 views)
sbgtrading is offline  
Reply With Quote
Old 04-04-2008, 01:07 AM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Thanks for the fix Ben.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-05-2008, 10:02 AM   #8
achung
Junior Member
 
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 times in 0 posts
Default Are offsets correct? Difference between Sierra Charts and NT...

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
Attached Images
File Type: jpg NT_SMMA_(3).jpg (60.5 KB, 204 views)
File Type: jpg SC_SMMA_275(3).jpg (71.3 KB, 178 views)
achung is offline  
Reply With Quote
Old 04-05-2008, 02:13 PM   #9
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

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.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump

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


All times are GMT -6. The time now is 04:53 AM.