Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 10/6/2014 Posts: 34
|
I'm trying to build an indicator off of the Zig Zag Percent,
In my realcode Plot = ZZP.Value
it plotes lines connecting both the peaks and the bottoms of the Zig Zag percent.
How do I code it so it connects only the peaks of the Zig Zag percent?
Thank you.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Maybe something like the following?
If ZZP.DateValue = Price.DateValue AndAlso _
ZZP.Value > ZZP.Value(1) Then
Plot = ZZP.Value
Else
Plot = Single.NaN
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/6/2014 Posts: 34
|
Hi Bruce,
Thanks for responding so quickly.
I was thinking of ploting a horizontal line forward on each peak value until there is another peak value where the horizontal line would change going foward to that peak value. and the horiztonal lines would be connected with just a straight up or down line.
So the shape of the line would look more like
Plot= ZZP.Value
except the horizontal line would be going foward at peak value of the Zig Zag Percent.
I tried tinkering with the codes you just gave me, but still can't quite get it.
Thank you.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Maybe something like the following?
Static Peak As Single
If isFirstBar Then
Peak = Single.NaN
Else If ZZP.DateValue = Price.DateValue AndAlso _
ZZP.Value > ZZP.Value(1) Then
Peak = ZZP.Value
End If
Plot = Peak
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/6/2014 Posts: 34
|
That is excactly it.
Thank you Bruce, you're the best.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |