User:Hanna Khyl/Sandbox

ActFX is a proprietary programming language built in to the ActTrader platform, which is a financial instruments trading platform in use by currency traders worldwide, and owned by ActForex Inc. It allows users to realize their trading tactics by writing their own algorithmic trading strategies, as well as create custom indicators for price charts.

ActFX is based on PASCAL language, although there are some structural differences, some new functions and specific predefined procedures. Saved script files have the extension *.acti (for indicators) and *.acts (for strategies). The compiled executable files may also have the extension *.actic (for indicators) and *.actsc (for strategies).

Data types and object classes
A script in ActFX utilizes different types of objects. There are special object classes which allow the user to analyze chart history, instrument information, chart indicators, account information and strategy performance. Special object classes are used to manage trades and orders. General PASCAL data types can also be used in ActFX.

Available functions
ActFX supports the basic PASCAL functions, such as mathematical functions, date and time functions, data type conversion functions, string functions, message and sound notifications. It allows the user to work with arrays and TStringList class objects as well. There are several special trade functions, which are used to work with orders and positions. The user strategy in ActFX can open positions, place entry orders, stop/limit/trailing stop orders, close positions, modify and remove orders.

Script structure
A user strategy in ActFX is a script consisting of a number of procedures. Some of the procedures are triggered by certain events occurring in the system while the user can call others up manually. The procedures can react to such events as a new candle/new tick in the chart, a change in the trade list, order list, or account list, as well as a specific user command. From the 4.7 version of ActTrader a new event OnTimer is available. This event allows executing a procedure every selected time period.

ActFX algorithmic trading module
ActFX is also the name of a trading module designed to work with strategies/indicators written in the ActFX language. It has the following components: Indicator Editor, Strategy Editor, Strategy Details, Tester, Summary, MQL4->ActFX converter and the Indicators and Strategies window. Indicator Editor allows the user to create, modify, and add (compile) indicators written in ActFX language. Strategy Editor is a dedicated internal application designed for creating, reviewing, and editing scripts for automatic trading. The Indicators and Strategies window allows the user to manage scripts (both strategies and indicators) that are ready for backtesting and execution. When a strategy is launched, all the information on the strategy performance is displayed in an individual window.

Before the strategy is executed in real time, it can be tested against historical data. Back testing is a way to check how the strategy may perform. It is possible to test several strategies at the same time, or test several instances of the same strategy with different settings, which helps to compare the results of different tests.

MQL4->ActFX converter is an internal module that facilitates the translation of the MQL4 scripts advisers (MetaTrader 4 script language) into ActFX strategies. Converted strategies will be automatically opened in Strategy Editor.