NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 07-07-2008, 02:55 AM   #1
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default Bill Williams Strategy.

Hey Everyone,

I want to build a strategy that uses Bill Williams' Alligator indicator as the source for signals. I tried to get it to do the following:

If Lips crosses above Jaw: Up arrow.
If Lips crosses above Teeth: Up triangle.
If Jaw crosses below Lips: Down arrow.
If Teeth crosses below Lips: Down triangle.

I am using the Zero-Lag Moving Average. I could just chart read but the strategy would be useful in seeing if I read what the strategy does.

Any help would be appreciated. This is my first strategy and I want to learn as much as I can.
Last edited by Drakmyre; 08-21-2008 at 10:32 PM.
Drakmyre is offline  
Reply With Quote
Old 07-07-2008, 02:57 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

If the community would not contribute, then you could contact a certified NinjaScript consultant as last resort.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-07-2008, 03:03 AM   #3
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

In the file sharing section I already posted a version of the Alligator indicator you can use. No guarantees on indicator accuracy though. Was never fully tested.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-07-2008, 03:27 AM   #4
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,

I downloaded the indicator. I just want to know if anyone can develop a strategy that generates the arrows and triangles when the different crossovers happen.
Drakmyre is offline  
Reply With Quote
Old 07-07-2008, 08:54 PM   #5
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Hey Dierk,

How can I move the arrows to the right MA Crossing points? They always seem to stack on top of each other.
Drakmyre is offline  
Reply With Quote
Old 07-07-2008, 11:18 PM   #6
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

Make sure each DrawTriangle() has a unique string name associated with it. A common technique to do this is to do "Triangle" + CurrentBar for its name
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-07-2008, 11:47 PM   #7
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,

Here is the code. It has the "DrawTriangle" + Current Bar but the same thing happens.


// Condition set 1
if (CrossAbove(ZeroLagEMA(Lips).ZLEMA, ZeroLagEMA(Teeth).ZLEMA, 1))
{
DrawArrowUp("My up arrow" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Lime);
}

// Condition set 2
if (CrossAbove(ZeroLagEMA(Lips).ZLEMA, ZeroLagEMA(Jaw).ZLEMA, 1))
{
DrawTriangleUp("My triangle up" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Lime);
}

// Condition set 3
if (CrossBelow(ZeroLagEMA(Jaw).ZLEMA, ZeroLagEMA(Lips).ZLEMA, 1))
{
DrawArrowDown("My down arrow" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Red);
}

// Condition set 4
if (ZeroLagEMA(Teeth).ZLEMA[0] + 5 * TickSize == ZeroLagEMA(Lips).ZLEMA[0] + 2 * TickSize)
{
DrawTriangleDown("My triangle down" + CurrentBar, false, (int) (Close[0]), Close[0], Color.Red);
}
}
Drakmyre is offline  
Reply With Quote
Old 07-08-2008, 12:29 AM   #8
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

You will need to debug it as per this tip: http://www.ninjatrader-support.com/v...ead.php?t=3418

Check values on every step and variable. See what you are actually plotting as opposed to what you think the code is suppose to plot.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-08-2008, 01:22 AM   #9
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default Update.

Josh,

I get arrows and triangles(mostly arrows) appearing multiple times on the same graph when they should be there once. Down triangles don't appear at all. Any idea what to do?
Last edited by Drakmyre; 08-21-2008 at 10:32 PM.
Drakmyre is offline  
Reply With Quote
Old 07-08-2008, 01:31 AM   #10
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

Drakmyre,

Unfortunately due to bandwidth reasons we cannot debug every indicator/strategy on a case by case basis for every customer. You will just need to get down into the code and inspect it with Print() everywhere and such to find out exactly what is happening.

Areas to pay attention to would be any if statements you have. Print before the ifs, inside the ifs, and immediately outside the ifs. This will let you determine if you are entering the if logic properly. Print every value for every variable out. Run your logic with pen and paper and try to match it with what you are seeing on screen.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-08-2008, 01:41 AM   #11
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,

Thanks for the help! I just put it up there so if anyone wanted to take a look at it they could just download what I have worked on so far.
Drakmyre is offline  
Reply With Quote
Old 10-09-2008, 02:04 AM   #12
max-td
Senior Member
 
Join Date: Feb 2008
Posts: 177
Thanks: 0
Thanked 0 times in 0 posts
Default

hi Drakmyre,

where do i find to download what you have worked out ?

Thanks
max-td
max-td is offline  
Reply With Quote
Old 10-09-2008, 02:17 AM   #13
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default File.

Hey Max,

I dumped the idea and worked on just applying the Alligator already supplied on the site. It's a bit less volatile but follows the ZEMA lines very closely. From there I just wizard it.

I've done some other systems and am currently tuning them.
Drakmyre is offline  
Reply With Quote
Old 10-09-2008, 03:10 AM   #14
max-td
Senior Member
 
Join Date: Feb 2008
Posts: 177
Thanks: 0
Thanked 0 times in 0 posts
Default

OK np - i was interested in the way you created this stuff with formulas, arrows and so on ..... cause i am working on learning how to code at the moment and catch up every interesting sample + example i find

max-td
max-td 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
Request: Bill Williams Awesome Oscillator & Accelerator Oscillator jeremymgp Indicator Development 26 11-04-2008 08:41 PM
Plotting Stochastics over Bill Williams' AC egonline Charting 5 04-15-2008 04:00 PM
Bill Williams Indicators Tradertodd Indicator Development 4 02-23-2007 08:36 AM
Bill Shepard and Acccumulated Volume Depth Antraman ATM Strategies (Discretionary Trading) 1 06-01-2006 12:15 AM


All times are GMT -6. The time now is 03:50 AM.