Programming Help

 

Hi guys,

I'm trying to codefy a search for the mayors relative highs in EurUsd. I'm aiming to reach an array of x positions with the exclusive x higest relative (High - Open) highs, but with this attached code some odd results apears. The main idea is use the first position (Array[0]) to be a transient buffer (it just is used to catch each relative high). Then it is compared with the others positions to search for repeated values, it receives the zero value if it is a repeated value, if it isn't a repeated value, the whole array is sortedin the ascendet mode. The first position (Array[0]) is then seted to zero. I don't know exactly why, but at the end repeated values are still at the array.

Can anybody help me on this, please.

Tks, and high profits for everyone.

Files:
testii.mq4  4 kb
Reason: