Tuesday, October 14, 2014

AmiBroker AFL code Inside C / C++ Visual Studio

What is AFL?
AFL stands for AmiBroker Formula Language. AFL  is  a powerful language which follows C - like syntax. More on how AFL works is given here.
AmiBroker (www.AmiBroker.com) is wonderful trading/charting software which is used by billions of users around the globe.

Provided C/C++ platform on the top of ADK (Amibroker Development Kit) to edit/build Amibroker AFL scripts. One can virtually “cut and paste” the raw Amibroker AFL script directly into the Visual Studio C/C++ editor . Since AFL language is type less similar to PYTHON language, the only challenging task after copying the script into the C /C++, need to identify the array type and number type variables and declare them inside C accordingly. Build the C code and create a DLL. Use it as a Amibroker plugin DLL!.

  • Pure C/C++. No Managed code( .Net or Java) !!.
  • Say Goodbye to StaticVarSet StaticVarGet (AmiBroker functions) functions!!...
  • Use structures/classes , unions, static/un-named namespace variables inside C/C++ based AFL code. Amibroker AFL does not support these.
  • Use multi-threaded architecture with C/C++ AFL to design complex trading systems and complex money management rules.
  • Interface other high performance math libraries with C/C++ based AFL script.
  • Interface Artificial Intelligence (Neural network) code and other machine learning code very easily.
  • Interface STL library.
  • Performance is almost equal and in some cases greater than that of AFL scripts.
  • MOST importantly debug the AFL code inside Visual Studio! .
  • Port MT4 code to AFL C/C++ code easily.

Example:   The below graph is displayed on AMiBroker by calling single AFL entry function RTDF_AFL2C_DEMO1_PLOTOHLC(O,H,L,C)  which is implemented inside  the C DLL

The AFL code and its equivalent C/C++ code is given below.  Observe the code between _SECTION_BEGIN and _SECTION_END  blocks !! and spot the differences! J

The above code "attacking"  the Visual Studio 2008 Debugger !!



Contact rtdf.ab@gmail.com  for details.

No comments:

Post a Comment