ZigZag on Parabolic SAR

teeitup

Active Trader
Jul 24, 2010
2
0
32
value of peak and troughs from zigzag parabolic

I am wondering what code i would need to write in order to be able to call up the value of the last peak and 2nd last peak in the zigzag parabolic SAR indicator, and the same for the troughs. i want to be able to compare the two price values to determine trend. any help appreciated.
 

teeitup

Active Trader
Jul 24, 2010
2
0
32
thanks for that i am just starting out in progamming and so need some more advice, i am basically wanting to determine trend from the zigzag parabolic SAR indicator i.e. have another line or separate indicator whichever is easier, that is 1 if last peak is higher than the 2nd last peak or -1 if last trough is lower than 2nd lowest trough.