USA
Experience: Intermediate
Platform: NinjaTrader
Trading: NQ
Posts: 32 since Aug 2009
Thanks Given: 12
Thanks Received: 58
|
Hey guys, I think this should be an easy one, I hope, but I am somewhat of a hack with C# so I am having a bit of trouble.
I want to use a swing indicator (ZigZagUTCSwing at the moment, but open to suggestions if there is anything "better") to tell if the last swing high/low was higher or lower than the previous swing high/low. In the ZigZagUTCSwing indicator I see two DataSeries of hi and lo, presumably these are the swing high and low price values that are used by the indicator to determine how/what to plot? There is also a public int variable of direction, either 1 or -1, for the direction of the current zigzag trend. I have not reviewed the code in great detail, but this is how I currently understand it.
If I try to call the hi or lo DataSeries to compare the values in the strategy, I get an error "inaccessible due to its protection level". What does this error mean? So next I try to use the direction variable to determine the swing trend direction, but it appears to me that this variable is *always* 0. This doesn't make any sense, because the direction variable has to change 1/-1 in the ZigZagUTCSwing indicator for it to work!?
Maybe I am just going about this all wrong. All I want my strategy to do is only go long if both the last swing high and low were higher than the previous swing high and low, or go short if both the last swing high and low were lower than the previous swing high and low, excluding double bottoms and double tops (other entry criteria will also apply). Any ideas how I might approach this with ZigZagUTCSwing or some other similar indicator?
I've attached a quick example of what I mean, hopefully it makes sense. (The dots fire when my other entry criteria is met)
Thanks!
|