![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
If the community would not contribute, then you could contact a certified NinjaScript consultant as last resort.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
Hey Dierk,
How can I move the arrows to the right MA Crossing points? They always seem to stack on top of each other. |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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); } } |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#10 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Feb 2008
Posts: 177
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |