Double bottom with certain price level

I want to find if any double bottom is made within 1% of some fixed number, like 100,150,200,275,350 etc.
I can define double bottom using Zig function and one trough with the previous one.

But how to check if this double bottom is within 1% of those price level, like in case of 100 it should be within 99 to 101. Thanks

http://www.amibroker.com/kb/2014/03/06/using-zig-zag-in-trading-systems/

1 Like

thank you for the reply sir. the zig zag part is solved need help for testing if the peak or trough is within 1% of certain fixed number?

DoubleBottomWithin1Perc = max(previousBottom , LastBottom) * 0.99 <= min(previousBottom , LastBottom);

Sir, I have already defined the double bottom.

Now i just want to check if this double bottom is at the price level of 100 or 150 or 200....then only i am going to take it as valid. but if say it is at 112 then i am going to avoid it