Best Delphi code to implemente that

Indicators coded by community members
Message
Author
yousky
Posts: 15
Joined: Tue Apr 24, 2007 3:33 pm

Best Delphi code to implemente that

#1 Postby yousky » Tue Apr 24, 2007 3:37 pm

Hi Terranin and everyone, i'm trying to convert an indicator from MT4 to ForexTester interface, but i've a problem to convert this fonction "iMAOnArray" !!!

Have you done this yet in some of your indicators, what is the bast way to implenete it, using dynamique array in delphi or what else ?

Thanks if you have some ideas.

PS: I want to convert for example this piece of code :
ExtMapBuffer2[i]=iMAOnArray(ExtMapBuffer1,Bars,MaPeriod2,0,MaMetod2,i);

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Best Delphi code to implemente that

#2 Postby Terranin » Tue Apr 24, 2007 4:33 pm

yousky wrote:Hi Terranin and everyone, i'm trying to convert an indicator from MT4 to ForexTester interface, but i've a problem to convert this fonction "iMAOnArray" !!!

Have you done this yet in some of your indicators, what is the bast way to implenete it, using dynamique array in delphi or what else ?

Thanks if you have some ideas.

PS: I want to convert for example this piece of code :
ExtMapBuffer2[i]=iMAOnArray(ExtMapBuffer1,Bars,MaPeriod2,0,MaMetod2,i);


I did not implemented this function, if you need it - replace with your own code doing the same thing.
For example for SMA it will be equal to:

Code: Select all

sum := 0;
for k:=i to i + MaPeriod2 - 1 do
  sum := sum + ExtMapBuffer1[k];
ExtMapBuffer2[i] := sum/MaPeriod2;


For EMA it is more complicated because you should process all array for the Bars - 1 and it can cause slow working so it is better to implement this code with yours.
Hasta la vista
Mike


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 2 guests