in Search

Write C/C++ code for MetaStock in minutes - No MDK required !!

Last post 09-01-2009, 9:50 by snoopy. 1 replies.
Sort Posts: Previous Next
  •  08-31-2009, 10:18 30567

    Write C/C++ code for MetaStock in minutes - No MDK required !!

    Vitamin-C for MetaStock sets new standards for MetaStock users !! For the first time you can transcend the limitations imposed by the MetaStock Formula Language(MSFL) without resorting to the obfuscation and complexities of the MetaStock Developer's Kit ! Vitamin-C offers full access to industry standard C/C++ code capabilties from within MetaStock in a user friendly environment. Now you can code the way that you always wanted to and focus on the end result rather than battle with the obstacles !

    More details from http://www.compuvision.com.au







    regards David
    http://www.compuvision.com.au
  •  09-01-2009, 9:50 30583 in reply to 30567

    Re: Write C/C++ code for MetaStock in minutes - No MDK required !!

    Some people have emailed me about how the software actually works with MetaStock.

    I will briefly explain by using a simple example of an Adaptive Moving Average.

    Developed by Perry Kaufmann, this indicator is an EMA (exponential moving average) using an Efficiency Ratio to modify the smoothing constant, which ranges from a minimum of fast length to a maximum of slow length.

    The following Vitamin-C script to implement this is saved to a file called 'AMA.c'

    void AMA()
    {
      float lastvalue=User1[ 0 ];     // approximate previous value at the start
      float newvalue;
     
      for(int i=1;i<BarCount;i++)   // loop for all bars
      {
        newvalue = User2[ i ] * User1[ i ] + ( 1 - User2[ i ] ) * lastvalue;
        Result[ i ]=newvalue;
        lastvalue=newvalue;
      }
     
      Result.SetFirstValidBar(1);   // ignore the first bar
    }


    You then call this script from MetaStock using the following code and substituting User1, User2 with the approriate MSFL code.

    ExtFml( "VitaminC.CallScript1",
    "AMA.c",          { name of script file }
    "AMA()",          { function name and no parameter }
    User1,            { User1 data array to smooth }
    User2             { User2 data array smoothing factor }
    );


    There is no use of compilers or complex DLL code to deal with. You just write and save the script and run it from MetaStock.

    regards David
    http://www.compuvision.com.au
View as RSS news feed in XML