The F4 Programming Framework and Asirikuy Tester: A simple FAQ

During the past few days I have received several emails from people interested in the tools we have available for system development and testing at Asirikuy.com. However there seems to be a wrong understanding about what our tools do, how they work and what they can achieve for you as a trader. For this reason I wanted to put together a simple FAQ about the F4 framework and other Asirikuy tools within the blog so that people outside of our community can get a better idea about what our community has to offer regarding system development tools. Through the following post I will answer some of the most common questions I have received regarding our trading framework and testing programs but do feel free to ask any additional questions you might have within the comment section.

2-4-2014 8-18-11 AM

What is the F4 framework?

It is a cross-platform programming framework written in ANSI C/C++ that simplifies the building and trading of simple and complex strategies for the Forex market. The F4 framework includes libraries for time correction (proprietary implementation), machine learning (Shark, FANN, Waffles), technical analysis (TA-lib), charting (ChartDirector), image processing (DevIL), web interfacing (curl), genetic optimizations (Gaul), etc. The F4 framework is paid open source. This means that you need to buy the right to use the framework – by joining Asirikuy – but after this you have access to the whole source code.

Why should I use the F4 framework?

The F4 framework provides you with a development environment that is completely unique in the FX trading world. While there are a lot of open-source  back-testing and system development libraries available (for example pandas in python or quantmod in R) there is no open-source library that matches the capabilities of the F4 framework for FX system development and live trading. The F4 framework allows you to develop strategies in the same code that you use to live trade them, it allows you to trade the same code live on a variety of front-ends and – most importantly – it includes code to perform absolutely necessary time refactoring corrections that are a unique need for the FX market. With the F4 framework you will never have to worry about whether your back-testing data has the same GMT shift or weekly opening/closing times as your live trading data, all these corrections are done automatically by the framework, giving you access to internal OHLC data that is as broker independent as possible.

Why isn’t it free?

The F4 framework and Asirikuy tools aren’t free because it is a lot of hard work to build/maintain/improve a professional programming trading framework. The fees paid to join Asirikuy (which gives people access to the framework and tools) allow me to have the necessary time to keep the framework at a level that is highly professional and as bug free and robust as possible. By having a paid implementation I can dedicate a lot of my time to this programming framework which benefits all of its users. Additionally I can also use this money to buy powerful commercial libraries (such as ChartDirector) that allow its users to develop more powerful and flexible solutions. The F4 framework is aimed at professional traders who value the work that needs to be put into such implementations.

How are systems built in the F4 framework?

You code your system within a C file inside the F4 framework, you then compile the framework and generate a library file which you can use to execute your strategy on any given front-end that has been created for the framework. Your system can be coded in C or C++, whichever you prefer. The F4 framework is self-contained, a single libary file – a DLL in windows – is produced. The production of a single library file containing all your systems and their library dependencies gives additional reliability and reduces problems due to dependencies, etc.

How are these systems traded?

The F4 framework library file can be accessed by several different front-ends, which are the ones responsible of the interaction with the broker. The front-end gets information from the broker, sends it to the F4 framework and executes any commands given back by the F4 framework. We currently have front-ends available for MT4, MT5 and the cross-platform Asirikuy Trader (a python trading platform we developed) that allows you to trade your systems in JForex or the Oanda REST API. This means that you can code your systems once in F4 and then trade them in a variety of different platforms. You can also back-test your systems through these front-ends as well (MT4, MT5, NST).

Do I have to use a given compiler/IDE to build the F4 framework?

No. The F4 framework project files are built with premake4 so you can compile the framework using a variety of different IDE and compiler options. In general we use Visual Studio 2010 to compile the framework on Windows but we use gmake to compile the framework on MacOSX and codelite to compile the framework on Linux (gmake and codelite both use the gcc GNU toolkit). You can also potentially use GNU tools to compile the framework on Windows using codelite if you wish to do so.

What is the New Asirikuy Tester (NST) ?

This is a program we developed in python to carry out back-tests of our trading strategies. The NST uses the F4 library file created using the framework to access your trading strategies and carry out back-tests outside of MT4. The NST is cross-platform implementation that allows you to run back-tests in MacOSX, Linux or Windows. In this way you can make your back-testing completely independent of MT4 and the Windows platform. In addition to this the NST supports custom genetic optimization, openMP (multi-core) and MPICH (Multiple computer) back-tests. With the NST you can optimize a system using all your computer cores and even a computer cluster (if you have access to one). The NST also allows for multi-instrument back-tests, portfolio back-tests and other types of simulations outside of the scope of MT4. The NST also uses accurate historical swaps derived from historical interest rates within its simulations.  Bear in mind that the strategies are NOT coded in python, they are coded in C/C++ within the F4 framework library file. The NST source code is also available to Asirikuy members so you can add any functionality you might want that is not currently present.

What are the limitations of the NST ?

The NST can carry out back-tests down to tick-by-tick resolution.  However there are some limitations dealing with the building of portfolios or when using data from multiple symbols. When building a system that uses data from multiple symbols (for example testing a system on the EUR/USD  using GBP/USD data as well) the data for these two symbols needs to have matching timestamps to ensure accurate testing.

Can I use my MT4 strategy with the NST ?

No, the Asirikuy Strategy Tester only works on strategies coded within the F4 framework. If you want to use our strategy tester you will need to convert your strategies to the F4 framework.

Can I create systems using R ?

Currently the F4 framework has a working R interface only in Linux/MacOSX (due to some compiler issues with the R headers for the R-C interfacing libraries in Windows). You can test/trade systems using R within a Linux/MacOSX environment if you wish to do so. However we week to be able to build the R interface in Windows in the future as well.

Can I use the F4 framework and Asirikuy tools to develop/test/trade outside of MT4 ?

Yes! The F4 framework allows you to develop trading strategies in Linux/MacOSX. You can test the systems using our New Asirikuy Tester (NST) and you can also live trade these implementations using the Asirikuy Trader. Right now you can trade in JForex or the Oanda REST API, so effectively you can have a complete live trading experience outside of MT4 using the F4 framework and Asirikuy tools.

What sort of system can I develop in F4 that I cannot easily develop in MT4 ?

There are many system implementation that are easy to put together in F4 that would be a complete nightmare to implement in MT4/MT5. For example you can create a machine learning strategy that re-trains on every bar using the past N bars of market data. Doing this in F4 is a matter of using one of our machine learning libraries, passing it the data received by the framework from the front-end, train it and get a prediction. You can then obtain a back-test for a constantly retraining machine learning system. In MT4 this is extremely difficult to implement and would probably take someone many months to do. In F4 this can be done in a small fraction of the time. We have several tutorials pertaining to system creation within the Asirikuy community, some of which contain machine learning examples.

I hope the above answers some of the questions you might have about the F4 framework and the tools that are currently associated with it. By joining our website (Asirikuy.com) you’ll obtain access to the F4 framework’s source code as well as the source code for all of the above mentioned tools. With the F4 framework you can trade using an open source implementation which is completely transparent to you. With our tools you can hopefully take your system development to the next level :o)

Print Friendly
You can leave a response, or trackback from your own site.

24 Responses to “The F4 Programming Framework and Asirikuy Tester: A simple FAQ”

  1. Hans says:

    Thanks for posting about your tools, this was something I never really got about what exactly you have available and how it does work. This is an eye opener for me and I am sure we will see us soon at your site;)

    • admin says:

      Hi Hans,

      Thanks for commenting :o) I’ll be surely glad to have you participate within our community! Feel free to ask any questions if you want to join. Thanks again for writing,

      Best Regards,

      Daniel

  2. […] Now don’t get me wrong, I am all for change and code improvements and many of the things that Metaquotes has done with the MQL4 language are good. There is now a debugger, access to an object oriented trading approach, etc, but this is simply not the way to roll out updates with such important changes. With many people using MT4 as a critical application for their trading, the rolling of anything on an automated fashion without user consent is absurd. If it was my company I would have introduced an explicit warning within the platform about such updates (obviously requiring user permission for updating) and I would have also warned that users should test their implementations on a demo before updating. But then again, Metaquotes seems to enjoy being a bully to their end-users (their customers are the brokers, not us) so it seems that anyone using MT4/5 will have to endure this in the long run. If you are looking for a solution, take a look at our F4 framework. […]

  3. Athar says:

    Daniel,

    Good job explaining MT4/5 600 and your F4 system.

    1. Given Asirikuy Trader, can trading strategies be written in Python besides C?

    2. Any plans to interface to Interactive Brokers and LMAX APIs as well?

    3. One thing I don’t see anywhere, but which makes a lot of sense to me: hedging (high-leverage) retail forex strategies with ETF currency options. I read about your curl non-forex data acquisition article. Now how about including ETF option trading as hedge for ‘regular’ forex trades as part of your F4? For a great options analysis package, see http://www.hoadley.net/options (Windows only), about $160 annually.

    There are many online brokers (some highly rated by Barron’s, e.g., TradeMonster, Interactive Brokers and others) offering stocks, options, forex and commodities trading on their combo platforms. So the above mixed forex-options F4 environment could result in a much wider market and better trading. Perhaps not too difficult to implement, given so many new online brokers have done it on a proprietary basis.

    Regards,
    Athar.

    • admin says:

      Hi Athar,

      Thanks for posting :o) Let me answer your questions:

      1. No, the strategies can only be written in C because the Asirikuy trader is simply a back-testing interface for F4 and F4 strategies need to be coded in C/C++. Strategies cannot be coded in python on this setup.

      2. We have no plans to interface with these API solutions right now but we certainly can if the need arises or if there is enough demand.

      3.Sure, we can consider this. Quantlib is also open source and has a lot of option analysis functionality. If there is enough demand from our users we will certainly implement features like this. We can certainly interface to brokers with more financial products (besides Forex) as the need arises.

      Thanks a lot for posting Athar :o)

      Best Regards,

      Daniel

  4. Jon says:

    Is there any reason why you explicitly do not support tick data backtesting in F4? Considering that was a big lack in mt4 (unless you use TickStory/Birt’s TDS), why wouldn’t you consider tick data or sub-minute bars to do your backtests?

    Is your program trader and backtester able to take advantage of multiple cores/processors and even GPUs.

    I use mt4 with TDS for tick data backtesting and it is SLOW relatively speaking. I know that I could finish much faster in a more robust backtester.

    • admin says:

      Hi Jon,

      Thanks for your comment :o) We didn’t support tick data initially because we didn’t need it to accurately simulate our systems. All of our strategies are developed with wide SL/TP targets across upper time frames (>1H) so tick data is overkill in this sense. Why would you run a back-test that lasts 100 times longer when you can carry out a back-tests that takes milliseconds using OHLC data with very similar accuracy ? (we confirmed this for our strategies). However this doesn’t mean that we won’t implement it, if Asirikuy members request it we’ll certainly consider adding tick data support. It is also true that the whole F4 source code is available so a person whose interested in adding it without waiting can do so as well.

      Our tester can also use multiple cores and even multiple computers (through MPICH), you could potentially run tests in clusters. Currently we do not support GPUs but we may consider to do this in the future if the need arises.

      I hope this answers your questions :o) Thanks for posting,

      Best Regards,

      Daniel

  5. James says:

    Hi Daniel,

    I have only been designing automated trading systems for about 6 months now and so I am by no means a professional programmer. I was just wondering how easy the migration from MQL4 is to designing trading systems in C within Asirikuy. For example do you have pre-built trading functions such as OrderSend etc? Or do they have to be designed from the ground up?

    Best regards,
    James

    • admin says:

      Hi James,

      Thanks for writing :o) We currently have functions designed to make trade opening/closing/modifying very simple. For example to open up a long trade you can use a simple function called OpenLongTradeEasy. Let me know if you have other questions,

      Best Regards,

      Daniel

  6. Tijo says:

    Do you have an documentation on the F4 programming functions you guys provide out-the-box? Also, does Asirikuy provide any tools to convert mt4 indicators to use in the F4 environment?

    • admin says:

      Hi Tijo,

      Thanks for writing. We do have doxygen documentation generated for the F4 framework, which explains the functions available in the environment, there are also coding tutorials and my personal help available if required. We do not provide any tools for the conversion of indicators to the F4 environment. Let me know if you have other questions,

      Best Regards,

      Daniel

  7. Tijo says:

    I didn’t receive anything yet..

  8. Vitor says:

    Hi..

    Can you send the documentation by e-mail please?

    The standard technical indicators are already included on F4 or need to use other librarys?

    Cluster MPICH is only useful for optimization (run many complete tests in parallel) or also the ML functions (Shark, FANN…) will be able to spread the calculations through the processors/threads?

    Xeon phi cards are recognized on Matlab as a cluster. Here using MPICH will be possible to use it in same way? According the MPICH website, phi co-processors are now supported.

    thanks

    • admin says:

      Hi Vitor,

      Thanks for posting. Let me answer your questions:

      1. I have just sent you an email with the doxygen documentation and a coding example.
      2. There are many indicators already included using the TA-lib library, which is part of the F4 framework. You can see a list of functions available in TA-lib here (http://ta-lib.org/function.html).
      3. The MPICH and OpenMP implementations are only implemented for parallel optimization. These are not implemented for parallel execution of machine learning functions using Shark or other ML libraries. However we have never tried this so it might be possible.
      4. Execution over the intel xeon phi architecture is not supported.

      Let me know if you have any other questions,

      Best Regards,

      Daniel

  9. Justin says:

    Hi,

    I learned C many years ago, not a programmer but can undestand some simple code. Can I implement the following auto trading easily using F4?

    1. submit a series of limit buy or sell orders initially,
    2. add some more orders when certain number of initial orders become open orders,
    3. check total profit reaching profit target then close all orders
    4. repeat 1.

    Could you briefly describe the steps of using F4 to do this above to trade on Oanda platform? Do I need to purchase Visual Studio to do this? May I have the documentation send to my email as well? Or may I suggest you let public to access the documentation and tutorial on Asirikuy.com so that the public can know whether your product and service meet their requirement before joining.

    Thank you.

    • admin says:

      Hi Justin,

      Thanks for writing :o) I will email you the doxygen documentation for the framework soon. About your comments:

      1. Yes, you can implement such a system using F4.

      2. You would need to code your system using the F4 framework, test it using our back-testing software, then trade it using the AsirikuyTrader software which uses the Oanda API. However it is important to note here that we use a virtual order wrapper with Oanda (because they don’t allow you to hold longs/shorts at the same time) so the limit/stop orders would be held internally by the program and would be executed when breached by the bid/ask (therefore they would not be broker side limit/stop orders). This can be an advantage however if you’re planning on setting a large number of limit/stop orders as you won’t be limited by the broker-side pending order limitations.

      3. You do not need to purchase visual studio. You can use visual studio express 2010 which can be obtained free of charge. Aditionally the F4 framework can also be compiled on Linux using codelite/gmake, which are both open source tools.

      Let me know if you have any further questions,

      Best Regards,

      Daniel

  10. R Srinivasan says:

    I am in the process of advising a client of mine as to your system. Can you provide me the documentation if it is not inconvenient?

    I did recommend he look at F4 but he comes back with questions which I am unable to answer as I myself am not much knowledgeable about it.

    I recomended because he wanted something that could use TA-Lib, python (or code around it), R and a little bit of C.. I know about TA-Lib/C is possible with your system but not too sure about python/R but I figured if it can handle C, there is every chance it would handle python too.

    Regards
    Ravi

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!
Show Buttons
Hide Buttons