Amibroker Median() function for Multiple Arrays

In trying build the MSR indicator introduced by David Varadi for Amibroker, I run into a shortcoming of the Amibroker Formula Language (AFL). The language does not allow for the Median() calculation over 3 price arrays (in this H,L,C). After several false attempts in AFL and consulting various sources of help, I decided to accept my fait and build my first .dll for Amibroker to calculate the Median across 2 Arrays or the Median across 3 Arrays.

Below are instructions to Download & Install.

Have fun with it!

– QD –

Instructions to install:
1. Download the  QuantingDutchman.dll
2. As WordPress does not allow .dll  or .zip files to be uploaded, you should change the extension from .doc to .dll.
3. Place the quantingdutchman.dll in the plugin folder of Amibroker

How to use:
Two functions are provided QDMedian2(x,y,period) and QDMedian3(x,y,z,period), where x,y,z are arrays and period is the amount of bars taken into account to calculate the median.

Sample code:
qdmed2=QDMedian2(C,H,10);
qdmed3=QDMedian3(C,L,H,10);
Plot(qdmed2,"QDMedian2",colorBlue);
Plot(qdmed3,"QDMedian3",colorRed);

Sample Graph:

http://cssanalytics.wordpress.com/2010/10/27/a-new-trend-indicator-msr/

25 thoughts on “Amibroker Median() function for Multiple Arrays

    • It would be nice to know if all readers have trouble with the plug-in, or that it works with other readers. So would someone that has the plugin loaded and working please reply to this comment ?
      QD

    • Guys, I just saw Tomasz comment in the Amibroker users group. He is explaining that when .dll is created with Visual C++ 2005 the user shoulld have the VC++ 2005 runtime libraries installed. As I did build the dll in VC++2005 I recommend you to download these and to install them.
      QD

  1. Q,
    Don’t know if you tried this or not but rename your dll in Ami, download from the link and see if Ami sees it and it works. Maybe something on the upload or download.

    J

  2. Yes , even i am facing same problem..amibroker dosent see this Dll,
    it will bettrer if you upload .DLL on 4shared or rapidshare.
    sorry for trouble , but this will save everyones time
    Thank you

    • Just to be clear you need to change the extension of the downloaded file to .dll
      If you do this, than Amibroker should see it. If Amibroker does not see it, uploading to 4shared won’t help either.
      QD

  3. I am intrested – how you make this dll? i want to add some c++ project to amibrocker, what i neeed to do?

      • QD,

        Yap already reading tutorial there. Thanks!

        BTW – just intresting could you share that part of code for external function in dll creating? May be even in different post – i think a lot of people will be intrested in adding their own fast function to ami, and how easy they can do it – just past copy your text add math – complide- add dll go =)

  4. QD,

    Thanks for putting this together and releasing to the public!

    Works well on my system: Windows 7 32bit, Amibroker 5.00.1.

Leave a Comment