Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Zig Zag Percent Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ansinzhou
Posted : Tuesday, November 25, 2014 10:24:49 AM
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.

Bruce_L
Posted : Tuesday, November 25, 2014 10:36:51 AM


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
ansinzhou
Posted : Tuesday, November 25, 2014 10:56:38 AM
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.

Bruce_L
Posted : Tuesday, November 25, 2014 11:11:50 AM


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
ansinzhou
Posted : Tuesday, November 25, 2014 11:13:52 AM
Registered User
Joined: 10/6/2014
Posts: 34

That is excactly it. 

Thank you Bruce, you're the best. 

Bruce_L
Posted : Tuesday, November 25, 2014 11:16:14 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.