iHighest equivalent

Indicators coded by community members
Message
Author
soheilpro
Posts: 13
Joined: Mon Mar 23, 2009 12:53 pm

iHighest equivalent

#1 Postby soheilpro » Sun Jul 19, 2009 1:28 am

Hi Everyone,
I was wondering if someone knows a function in forex tester that is similar to the iHighest function in Meta trader.
I am trying to re-write the Aroon indicator in forex tester.

Thanks

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#2 Postby dackjaniels » Sun Jul 19, 2009 9:02 am

Hi soheilpro,

The closest function to iHighest is FT's GetHighestValue (and to iLowest, FT's GetLowestValue), though you may have noticed they are not the same. iLowest returns the bar index of the lowest value in the specified range whereas GetLowestValue returns the lowest value (price) of the specified range (not the bar index).

I wrote the following functions a while ago as a direct equivalent to the iHighest and iLowest functions in MT4. Assuming you use Delphi you can simply copy and paste them in, if you use C++ you will need to use the principles to create your own function.

Also, bar shift can be stored in an integer so not sure why I used a double for the returned value, either way it still works.

Code: Select all

function  GetHighestValueIndex(ValueType: TValueType; StartIndex, count: integer): double;
var
  i: integer;
  v, tmp: double;

begin
  tmp := value(ValueType, StartIndex);
  result := StartIndex;
  for i:=1 to count - 1 do
    begin
      v := value(ValueType, StartIndex + i);
      if v >= tmp then
        Begin
          tmp := v;
          result := StartIndex + i;
        End;
    end;
end;


function  GetLowestValueIndex(ValueType: TValueType; StartIndex, count: integer): double;
var
  i: integer;
  v, tmp: double;

begin
  tmp := value(ValueType, StartIndex);
  result := StartIndex;
  for i:=1 to count - 1 do
    begin
      v := value(ValueType, StartIndex + i);
      if v <= tmp then
        Begin
          tmp := v;
          result := StartIndex + i;
        End;
    end;
end;



Hope this helps! :)

soheilpro
Posts: 13
Joined: Mon Mar 23, 2009 12:53 pm

#3 Postby soheilpro » Sun Jul 19, 2009 1:57 pm

Hi DackJaniels,

Thanks Soo much for your response. much appreciated. the Aroon indicator is a trend detection indicator that works based on the highest high and lowest low index based on a predefined lookup period.
since you've already coded the required functions that is 95% of what this indicator does, i was wondering if you can kindly create the DLL for this indicator and save all the C++ programmers the time to rewrite the code in C.
This is only a suggestion. again i appreciate your kind response and assistance.
a more detailed description and rules for calculation for this indicator can be found below:

http://forex-indicators.net/aroon

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#4 Postby dackjaniels » Mon Jul 20, 2009 5:03 am

soheilpro, please check your PM.

Thanks,
Steve

User avatar
Tantalus
Posts: 302
Joined: Fri Mar 23, 2007 3:51 pm
Contact:

#5 Postby Tantalus » Mon Jul 20, 2009 2:45 pm

The Aroon indicator and also the Aroon Oscillator are available on my website:

www.tantalusonline.com

Come take a look!

Brian-
Tantalus Research - Developing 21st Century Trading Systems.


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 7 guests