Pivot Projection
Author: ayc868
Creation Date: 4/24/2008 2:53 AM
profile picture

ayc868

#1
CODE:
Please log in to see this code.


PLease help on this , thanks.
profile picture

Eugene

#2
CODE:
Please log in to see this code.
profile picture

ayc868

#3
try to convert to WL5
http://wl4.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=22317

but can not get it right, please help on this.

CODE:
Please log in to see this code.
profile picture

Cone

#4
Notes:
1. Pivot Projection is a very inefficiently-written piece of code. It draws the same lines over and over needlessly (although you can't see this because they're super-imposed).

2. If you program that script in WL5 using the Value method (as above), it will be even more inefficient.

Guys, the Value method for WL5 indicators should rarely be used. It's the same as the SingleCalcMode in version 4. In Version 5, 99% of the time it's best to use the Series method so that the entire series is calculated once, cached, and then you can reference its values using the indexer - [].

3. If you zig-zag two different series (High and Low in this case), you're likely to find a point in which a new trough doesn't occur between 2 consecutive peaks, and vice-versa. Since the script always looks for the peak before a trough, in effect it masks this phenomenon, although every now and then you're likely to see a trough higher than a peak, for example.

Here's a better start. This version skips right to the peaks and troughs without looping through each bar -

CODE:
Please log in to see this code.
profile picture

Eugene

#5
ayc868, I'll just add a little bit to this valuable tutorial.

Insert this fragment after:
//firstPass = false;
to see the fibs:

CODE:
Please log in to see this code.
profile picture

Cone

#6
Thanks Eugene. I've added this to the code above, however, I think the retracements should be projected forward in time (so I made that change).