ZigZag
<< Click to Display Table of Contents >> ZigZag |
The ZigZag indicator highlights trends based on user defined threshold values and helps filtering the noise in price charts, it's not a classical indicator but more a reactive filter showing extreme price points. In processing it's calculations it can update it's current direction and price extreme point based on newly incoming data, the current developing leg should be thought of temporary until a new leg in opposite direction has been set.
You can access methods within this indicator to determine the number of bars ago a zigzag high or low point occurred or the current zigzag value, it is only meaningful to work with in Calculate.OnBarClose mode for the Calculate property.
High Bar
ZigZag(DeviationType deviationType, double deviationValue, bool useHighLow).HighBar(int barsAgo, int instance, int lookBackPeriod)
ZigZag(ISeries<double> input, DeviationType deviationType, double deviationValue, bool useHighLow).HighBar(int barsAgo, int instance, int lookBackPeriod)
Low Bar
ZigZag(DeviationType deviationType, double deviationValue, bool useHighLow).LowBar(int barsAgo, int instance, int lookBackPeriod)
ZigZag(ISeries<double> input, DeviationType deviationType, double deviationValue, bool useHighLow).LowBar(int barsAgo, int instance, int lookBackPeriod)
An int value representing the number of bars ago. Returns a value of -1 if a swing point is not found within the look back period.
High Value |
double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.
* A return value of 0 (zero) indicates that a zigzag high or low has not yet formed.
barsAgo |
The number of bars ago that serves as the starting bar and works backwards |
deviationType |
Possible values are: |
deviationValue |
The deviation value |
input |
Indicator source data (?) |
instance |
The occurrence to check for (1 is the most recent, 2 is the 2nd most recent etc...) |
lookBackPeriod |
Number of bars to look back to check for the test condition. Test is evaluated on the current bar and the bars in the look back period. |
useHighLow |
When true, both High and Low price series are used. When false, the default input is used for both highs and lows. |
// Prints the high price of the most recent zig zag high |
You can view this indicator method source code by selecting the menu New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.