[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Peak and Tough Functions



PureBytes Links

Trading Reference Links

 I don't understand how the Peak and Trough functions work?
I would like to have a condition that if Peak 1 > Peak 2 then continue.
Peak 1 would be the most recent hhv as a peak and peak 2 would be the 
peak before peak 1. To me a peak is defined as Ref(high,-2) < Ref(high,-
1) and Ref(high,-1) > high today. 
 The below says that Peak needs a % change and something about Zig Zag 
function. I just want the latest peak to be greater than the peak 
before it.

peak(ARRAY, change, n = 1)  
RETURNS ARRAY  
FUNCTION  Gives the value of ARRAY n-th peak(s) ago. This uses the Zig 
Zag function (see Zig Zag) to determine the peaks. n =1 would return 
the value of the most recent peak. n =2 would return the value of the 
2nd most recent peak. Caveat: this function is based on Zig-Zag 
indicator and may look into the future.  
EXAMPLE peak(close,5,1)  

THANKS
Ernie