![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2008
Posts: 97
Thanks: 0
Thanked 1 time in 1 post
|
Will someone explain to me when a new zigzag high or low is actually formed? Is it after a certain number of bars? If my thinking is way wrong will someone just explain the actual technical ways it is calculated and plotted. Thanks!
GT |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Nov 2009
Location: Denver, CO
Posts: 1,424
Thanks: 0
Thanked 3 times in 3 posts
|
Hi GreenTrade,
You can view the code for the ZigZag at "Tools>Edit NS>ZigZag" Also, here is the description: The ZigZag indicator shows trend lines filtering out changes below a defined level. Hopefully there are others that would like to give their input.
Tim
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2011
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I want to display the deviation value above/below each bar.. Also want to display this value as the currentbar is forming.. I'm new to this language so strangling to work out what is the name of the value is. I know that you have to set a reference deviation value so that when it is breached a blue line is plotted. And where in the code it is found? I want to use the DrawText object. example.. DrawText("DeviationTag", currentdeviationValue, 0, 20,Color.Blue) The reason I want to do this is for learning pruposes..want to see exactly what is happening. There must be a Dynamic Deviation value as well as a value that is stored when the reference Deviation Value is breached. Cheers Bruce |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Bruce,
Thanks for the post and welcome to the NinjaTrader forums! This page can help you with some code drawing tips. One thing you'll want to do is add + CurrentBar to the tag to allow uniquely tagged drawing objects. You also might want to base the Y position on bar objects, like highs or lows. DrawText("DeviationTag" + CurrentBar, currentdeviationValue, 0, High[0],Color.Blue); An example of using StdDev is available here: http://www.ninjatrader.com/support/h...ion_stddev.htm
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2011
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
ok thanks for the info..
Can anybody tell me if I want to display the current deviation value..what is the name of the string or INT? As far as I can see the user inputs a reference value named 'Deviation Value'...this may be say 0.08 if using percentages as type.. The program obviuosly works out the current deviation value as each candle(bar) is forming. Once this 0.08 value is exceeded a blue line is drawn. So just need the name of the string of INT variable so I can print to screen. Thanks Bruce |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
You can edit the ZigZag source code if you want to see more info on how internal variables are defined. DeviationValue in this indicator is an input, so the value is only what a user types in when applying.
[Description("Deviation in percent or points regarding on the deviation type")] [GridCategory("Parameters")] [Gui.Design.DisplayName("Deviation value")] public double DeviationValue { get { return deviationValue; } set { deviationValue = Math.Max(0.0, value); } }
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Feb 2011
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Ryan,
Thanks for your help.. I've worked out the deviation Values location.. Have another question on how we can save and edited script. EG ZigZag. If I use the NInja editor and copy and paste code from the ZIGZAG indicator to a new indicator say named ZZ2 when I click save it looks like it saves it in the ninja folders as @ZZ2.cs where I can also see the @ZigZag.cs indicator but when I want to add my new ZZ2 to a chart the ZZ2 indicator is not listed. Is there something else I need to do? Cheers Bruce |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Bruce, you would not only want to save your code, but press F5 in the editor to compile it into the custom assembly used to run your code at runtime, after this step your indicator should become selectable from the chart.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| zigzag | mullum | Automated Trading | 10 | 06-17-2011 12:12 AM |
| zigzag utc | magsab | Indicator Development | 3 | 06-17-2010 01:41 PM |
| ZigZag Values | clfield | General Programming | 4 | 12-02-2008 11:48 AM |
| zigzag problem | Creamers | Indicator Development | 5 | 08-01-2008 02:46 AM |
| ZigZag not visible | JonesWooHoo | Charting | 2 | 10-08-2007 05:42 PM |