NSFX_Quants Automated Trading Tools
The Expert Advisors for this project will only work with trading accounts opened through brokers section of this website for ease of monitoring and collaborations.
After opening your trading account, share the account number for inclusion by text to 0727-999-097.
To show maximum number of candles on your MetaTrader 4 chart, please go to Tools > Options and select the Charts tab.
Enter Max Bars in history – 2147483647 and Max bars in chart – 2147483647. These are the maximum history and bars available in MT4 and will enable you to show more candles. Alternatively press and hold 9 until end both for bars in history and chart.
Click OK and Refresh charts to effect the changes.
– Download the 1 minute data for currency pair of your choice and save it on your computer.
– Once complete select close on the Download Complete window.
– Open the MetaTrader platform.
– Select Tools>History Center.
– Double click on the currency pair which you downloaded the data for, Highlight 1 Minute (M1).
– Select Import.
– Browse to the file you previously downloaded to your computer (remember it has .hst or csv extension) and select Ok. Now the file has been uploaded to the History Center.
– Next open the chart you have imported, refresh the chart and scroll back to see the updated chart. Do this by right-clicking directly onto the chart and selecting ‘Refresh’.
Access the History Centre using F2 or from Menu-Tools-History Centre
It is possible to load quotes for basic currency pairs starting with year 1999 from the historical data server. To do it, it is necessary to select the desired symbol and press “Download”.
Upon pressing the button, data of M1 timeframe will be loaded. Other timeframes will be automatically recalculated from М1. At that, the time of the downloaded data will be automatically recalculated according to the active account time zone.
When downloading historical data, it is recommended to control amount of bars in history and in charts.
Attention: The deeper is the history used, the more PC resources are needed.
Quotes are weekly updated on the server of historical data. Further, at restarts, only updated quotes will be downloaded.
Refresh your charts to display this new change. Do this by right-clicking directly onto the chart and selecting ‘Refresh’.
The Metatrader platform gives you the ability to save your Expert Advisor (EA) settings to a file (.set).
Firstly I want to mention that you can save the settings for a custom indicator or a script as well, and not just for the EA. Settings saved into a file can then be loaded at any time. You can also transfer the settings file and load it up on another computer that’s running EA. This gives you the option to share the settings file with your fellow traders or send it to your support team if they are investigating a problem that you have with EA.
EA settings can be saved from the “Inputs” tab of the EA properties window. This appears when you attach an EA to a chart. The EA properties window always comes up first before EA is executed to allow you to set your desired settings. After the settings are entered, before you click OK to execute the EA you can save EA settings to a file by clicking on SAVE button near the OK button.
Click the Save button on the right. A “Save to file” dialog window will appear.
Choose the destination folder where you want to save your settings file. Take a note of where you save the file so you could find it later.
Enter file name you want to use
Click Save again.
That’s it. Your settings should now be saved into the .set file in your chosen destination folder, and you are returned back to the EA properties window. Now you can click OK to execute the Expert Advisor.
While the EA is running on the chart you can open the EA properties window again to make changes to EA settings, save the settings, or load settings from the previously saved .set file.
Click the right mouse button on the chart where EA is running. A popup menu should appear. From this popup menu, select Expert Advisors -> Properties. You can also do this by pressing the F7 button on your keyboard. The EA properties window should now open up and allow you to change, save or load the new settings.
Now that you have your settings file saved to your computer, you can load the settings into the EA at any time. To load the settings from a .set file you need to follow the same procedure and open the Inputs tab of the EA properties window. Then, instead of clicking the Save button you simply need to click the Load button and choose the file that you want to load the settings from.
In some cases you might find that the Input tab is not present. This just means that the EA does not have any settings for you to save.
Before starting to test expert advisors, one has to perform the setup. This means that one has to:
– select an expert and set up its inputs
– select a symbol and its period
– select one of three modeling methods
– set the testing time range (optional)
– To test and optimize experts, a special “Tester” window is used in the terminal. All above parameters are set in the “Settings” tab of this window.
One has to select an expert to be tested in the “Tester – Expert Advisor” field. One cannot select any expert file in this field. Only those experts that are available in the client terminal can be selected here. To be selected, they must be compiled and located in the /EXPERTS folder.
After an expert has been selected, one has to perform additional setting of testing parameters and inputs. This can be done by pressing of the “Expert properties” button.
A new window with three tabs will appear then:
#Testing – general testing parameters are set in this tab. These are volume and currency of the initial deposit to be given in the corresponding fields. It is this deposit that will be operated by the expert during testing. Types of positions to be opened at testing are defined here, as well: Only Long – open only long positions; Only Short – open only short ones; Long and Short – open both long and short positions. Whatever expert algorithm is, it will open positions only in the defined directions. One can include an optimization genetic algorithm and select a parameter to be optimized (maximization by the balance value, the profit factor, expected payoff, or minimization by the maximal drawdown value or drawdown percent).
#Inputs – the list of all inputs is given here as a table. Inputs are variables that influence the expert operation and can be changed directly from the client terminal. There is no need to change the expert code in order to change these parameters. The amount of input variables can change depending on the expert. At testing, the expert inputs are defined in the “Value” field. Data written in the fields of “Start”, “Step”, and “Stop” do not influence expert testing and are necessary just for optimization of its parameters. How to work with these parameters is described in the “Optimization Setup” section.
#Optimization – settings in this tab allow to limit testing passes at optimization. Changing of parameters in this tab does not influence single testing passes of the expert.
To start testing, it is not enough just to select an expert and set it up. One has to select a symbol and a period (timeframe) for testing. These are data that will be used for testing. At testing, one can select an available in terminal symbol or use an external data file. History data files of *.FXT format stored in the /TESTER directory are used in testing. These file are created automatically at testing if an available in the terminal symbol was selected.
The symbol is defined in the field of the same name, and Timeframe is in the “Period” field. If no data file for this symbol, period and modeling method does not exist yet, it will be created automatically. If there are no history data for the symbol or period, the tester will download the last 512 history bars automatically.
Historical data are saved in the terminal only as bars and represent records appearing as TOHLCV (HST format). These data can be used for modeling of price changes at testing experts. In some cases, such information is not enough for testing. For example, for the daily timeframe, price changes within a bar can result in triggering of the expert. At the same time, no triggering can occur at testing. In other words, testing an expert based on only bars can be inaccurate and give a false idea about the expert efficiency.
The trading terminal allows to test experts by various methods of historical data modeling. Using historical data from smaller periods, it is possible to see price fluctuations within bars, i.e., price changes will be emulated more precisely. For example, when an expert is tested on one-hour data, price changes for a bar can be modeled on one-minute data. Thus, modeling brings historical data near the real price fluctuations and makes expert testing more authentic.
One of three methods of historical data modeling can be chosen for testing:
****Open prices only (fastest method to analyze the bar just completed)
Some automated trading systems do not depend on properties of modeling within a bar, they trade on completed bars. The bar is completed if the next one has appeared. These are such experts for that this modeling method was developed.
In this mode, the bar opening is modeled first (Open = High = Low = Close, Volume=1) what allows the expert to identify the completion of the preceding bar precisely. It is this incipient bar that is used to start testing the expert. At the next step, the fully completed current bar will be given, but no testing is performed on it!
****Control points (the nearest less timeframe is used)
The control points modeling method is intended for a crude estimate of experts efficiency that trade within the bar. The historical data of the nearest less timeframe must be available to apply this method. In some cases, the available data of the less timeframe do not completely cover the time range of the timeframe under test. If the data of the less timeframe are missing, the bar evolution is generated on the basis of predefined wave templates as it was in the preceding, third version of MetaTrader 3 Client Terminal.
As soon as historical data of the less timeframe appear, these new data will be interpolated. However, the really existing OHLC prices appear as control points. In the most cases, the results of testing experts by method of control points can also be considered as estimated ones, not as final ones. Such results are of intermediate, estimated nature.
****Every tick (based on all available least timeframes)
This is the most accurate method of modeling prices within a bar. Unlike that of “control points”, this method uses for generation not only data of the nearest less timeframe, but also those of all available nearest timeframes. At that, if there are data of more than one period for the same timeframe at the same time, the data of the least timeframe will be used for modeling. Like in the preceding method, control points are generated on the basis of OHLC data of the least available timeframe. To generate price movements between control points, interpolation based on predefined templates is also used, so one-minute data are highly desirable to be available that would cover the entire testing range. It is possible that several similar ticks are modeled one after another. In this case, the doubled quotes will be filtered out, and the volume of the last of them will be fixed.
One has to consider the possible large amount of tick data modeled. This can influence the consumed resources of the operation system and testing speed.
The modeling quality can be checked in the “Report” window. The “Modeling quality” field and a colored band are intended for this. The band is a scheme of the modeling process. It can be of three colors:
#Gray – this part of available data did not participate in testing. Gray color can appear if the date range was specified for testing (described below);
#Red – modeling was not performed in this space because of missing data of a less timeframe. At that, only data of the timeframe selected for testing were used;
#Green – modeling was performed in this space. And the brighter is the color, the higher the modeling quality was. For example, at testing on H1 period, the deep-green band can mean that data of M30 period were used for testing, and the brightest one does that M1-period data are used.
The price history stored in the client terminal includes only Bid prices. On default, to model Ask prices, the strategy tester uses the current spread of a symbol at the beginning of testing. However a user can set a custom spread for testing in the “Spread” field.
The range of dates allows to test experts not on all available data, but within a certain time space only. This can be useful if there is a need to test a certain part of history data. Date range can be used not only for expert testing, but also for modeling of the testing succession of bars (file of data modeled to be used for testing). It is often no need to model data of the entire history, especially for every-tick modeling where the amount of unused data can be very large. That is why, if data range was allowed to be set at the initial modeling of testing succession, bars that are beyond this range will not be modeled, but just transcribed into the output succession. The data will not be excluded from the succession in order the correct calculation of indicators on the entire received history to be possible. It must be noted that the first 100 bars will not be modeled either. This limitation does not depend on the date range defined.
To enable date range limitation, one has to flag “Use date” and specify the necessary values in the fields of “From” and “To”. After all settings have been made, one can press the “Start” button and start testing. After testing has started, the approximate time of completing of this process can be viewed in the lower part of the window.
If the “Visualization” is flagged, after the “Start” button has been clicked, the chart will be opened automatically, on which the modeled tick sequence will be played. The playback speed can be regulated. The playback can be suspended by clicking the “||” button. The repeated click on this button resumes the income of the modeled ticks. Pressing of F12 causes immediate appearance of the next tick even in the suspension mode. Visualization can be skipped up to a certain date. After the desired date is set and the “Skip to” button is clicked, visualizing will stop and then resumed after the tester reaches the defined date.
Optimization – this tab allows to manage limitations during optimization. If any of conditions is met during a separate pass, this pass of the expert will be interrupted. Optimization will continue with the next pass.
To enable a limit in condition, one has to flag it in the checkbox to the left of it. Double click with the left mouse button in the “Value” field can be used to change the existing parameter; after typing new value, press “Enter”. Limiting parameters are:
-Balance minimum – the smallest balance value in the deposit currency;
-Profit maximum – the largest profit in the deposit currency;
-Minimal margin level % – the lowest margin level in per cents;
-Maximal drawdown % – the largest drawdown in per cents;
-Consecutive loss – the largest loss within a series. Loss series is a number of consecutive loss trades;
-Consecutive loss trades – the largest amount of loss trades within a series;
-Consecutive win – the largest total profit within a series. Profitable series is a number of consecutive profitable trades;
-Consecutive win trades – the largest amount of profitable trades within a series.
Best for testing VPS for beginners. Unstable though as re-boots are unplanned. Downtimes are common. Check from time to time if the sever is up and running.
1. Sign up on Google Cloud Platform Free Tier using link below
2. Login to your console and create new project
3. Navigate to Compute Engine and create New Instance
4. When setting up New Instance make sure to change boot disk to Windows Server 2008
5. After Instance is setup, navigate to instances list, on far left download the rdp file to your desktop, set password and start instance.
6. Copy mt4 to server together with algos and setup.
7. The server will be accessed from phone and computer using RDP Connection.
Suitable for running multiple mt4s.
All re-boots are planned and properly scheduled. Minimal downtimes.
To receive a virtual terminal, connect by the appropriate trading account, open the context window of the Navigator and execute Register a Virtual Server “Register a Virtual Server” option.
The Virtual Hosting wizard will automatically select the server that is closest to your broker. In the wizard window, you will see how ping (network latency) will decree compared to your current connection. Lower network latency between your platform and the broker’s server provides better condition for the execution of trading operations, such as reduced slippage and probability of getting re-quotes.
If you do not have enough money on your MQL5.community account to pay for the hosting, you do not need to go to the website and fund it. You can pay for the hosting straight from one of the payment systems. Just click “Next” after choosing the rent plan. Then choose a suitable payment system.
To maintain a clear and unified history of rented virtual hosting platforms, the required amount will be transferred to your MQL5.community account first, from which a payment for the service will be made. You can easily access and review all your payments from your MQL5.community Profile.
After paying you will pass to the last step of renting where you can perform the migration right away.
Migration is transferring the current active environment from the client terminal to the virtual one. This is a simple and straightforward way to change the set of launched programs, open charts and subscription parameters in the virtual terminal.
Preparing for Migration
Before launching the virtual terminal, you should prepare an active environment for it – charts, launched indicators and Expert Advisors, Signal copying parameters and the terminal settings.
Watch Youtube video: Preparing to Migrate Robots and Signals
Watch Youtube video: Preparing to Migrate Robots and Signals
How to setup a trading environment, in order to execute your trading robots and signals on a virtual platform for 24 hours a day?
Charts and Market Watch
In the Market Watch window, set up the list of symbols critical for your Expert Advisors’ operation. We recommend that you remove all unnecessary symbols to decrease the tick traffic received by the terminal. There is no point in keeping hundreds of symbols in the Market Watch if only a couple of them are used for trading.
Open only the charts that you really need. Although there are no limitations on the number of open charts, there is no point in opening unnecessary ones. Color settings do not matter.
Set “Max bars in chart” parameter in Charts tab of the terminal settings. Some custom indicators are developed in a wasteful way and perform calculations on all history available on the chart. In that case, the lesser the specified value, the better. However, make sure that the indicator works correctly with these settings by restarting the terminal after changing this parameter.
The virtual terminal has been designed so that it automatically downloads all available history from a trade server, but not more than 500 000 bars are available on a chart.
Indicators and Expert Advisors
Apply to the charts all indicators and Expert Advisors that are necessary for the terminal’s autonomous operation. Most trading robots do not refer to indicators on the charts, so check out and decide what you really need.
Products purchased on the Market and launched on the chart are also moved during migration. They remain completely functional, and the number of available activations is not decreased. Automatic licensing of purchased products without spending available activations is provided only for the virtual terminal.
DLL calls are completely forbidden in the virtual terminal. During the first attempt to call a function from DLL, the launched program is stopped with the critical error.
During platform synchronization with the virtual server, charts without Expert Advisors are ignored, even if custom indicators are running on these charts. If you need to migrate a custom indicator, run it on the chart of an “empty” Expert Advisor that does not perform operations. Such an Expert Advisor can be easily generated using the MQL5 Wizard in MetaEditor by selecting “Expert Advisor: template”. This is to ensure that indicators are migrated on purpose.
All external parameters of indicators and Expert Advisors should be set correctly. Check them once again before launching synchronization.
Scripts cannot be moved during migration even if they have been launched in an endless loop on the chart at the time of synchronization.
Configuring Email, FTP and Signals
If an Expert Advisor is to send emails, upload data via FTP or copy Signal trades, make sure to specify all necessary settings. Set correct login and password of your MQL5.community account in Community tab. This is necessary for Signal copying.
Permission to Trade and Signal Copying
The automated trading is always allowed in the virtual terminal. Therefore, any Expert Advisor with trading functions launched during synchronization can trade on the virtual terminal after the migration. Do not launch the Expert Advisors you are not sure about.
When migrating Expert Advisors, autotrading function is automatically disabled in the local terminal. This is done is order to prevent the situation when two terminals connected with the same account trade with the same Expert Advisor.
Regardless of whether autotrading is allowed or forbidden in your client terminal or in the properties of a launched Expert Advisor, any trading robot is allowed to trade after being moved to the virtual terminal.
Set necessary trade copying parameters in Signals tab. If a trading account has an active subscription and trade copying is allowed, permission to copy signals is disabled in the client terminal during migration. This is done in order to prevent the situation when two terminals connected to the same account copy the same trades simultaneously. It is not necessary to turn on signal copying on the local terminal when migrating to a virtual terminal where the signal is already running.
The “Synchronize positions without confirmations” setting is always enabled in the virtual platform. The virtual platform has no user interface, the operations are copied only automatically, and it is impossible to confirm them manually.
Trade copying is automatically enabled on the virtual terminal when migration is complete. Message about copy cancelation in the client terminal is also repeated in the journal.
If a program that is to operate in the virtual terminal uses WebRequest function for sending HTTP requests, you should set permission and list all trusted URLs in Expert Advisors tab.
Migration is performed during each synchronization of the client terminal. Synchronization is always a one-direction process – the client terminal’s environment is moved to the virtual terminal but never vice versa. The virtual terminal status can be monitored via requesting the terminal’s and Expert Advisors’ logs as well as virtual server’s monitoring data.
To perform synchronization, open the context menu and select migration type. There are several types of migration that should be used depending on the objective:
All – complete migration is necessary if you want to simultaneously launch Expert Advisors/indicators and trade copying. In this mode, account connection data, as well as all open charts, signal copying parameters, launched Expert Advisors and indicators, FTP and email settings are moved to the virtual server.
Experts – only Expert Advisors and indicators are moved, if subscription to Signals is not required. Unlike the complete migration, signal subscription parameters are not transferred in this mode.
Signal – only Signal copying settings (no charts or programs) are moved. In this mode, account connection data, signal copying parameters, FTP and email settings are moved to the virtual server.
Thus, you always can change the number of charts and the list of symbols in the Data Window, the set of launched programs and their input parameters, the terminal settings and Signal subscription.
All available history concerning the open charts is automatically uploaded during the first synchronization. Uploading history from a trade server can take some time, and all programs launched on the charts should process the updated data correctly during the synchronization.
When performing migration, all data is recorded in the client terminal’s log.
Logging migration process
After the synchronization, open the virtual terminal’s main journal to examine the actions performed on it.
Requesting the Journal from the Virtual Terminal
In the newly opened log window, you can set a piece of text the journal entries are to be filtered by and a desired interval. After that, click Request to download the found logs.
Viewing Journal logs
The virtual terminal’s logs are updated during each request and saved to [terminal data folder]\logs\hosting.*.terminal\.
The migration process has a number of features:
Automated trading is always allowed in the Virtual terminal even if it has been forbidden by the terminal settings or in the launched Expert Advisor’s parameters.
Scripts are not moved during migration even if they have been launched in an endless loop on the chart at the time of synchronization.
Charts with non-standard Timeframes and symbols are not moved.
This Algo trades based on the Bollinger Bands indicator. This Algo places a buy order when the price touches the upper band and sells when the price touches the lower band. When the invert is activated it does the opposite.
This Algo trades based on the CCI indicator. This Algo places a buy trade when the indicator value is coming out of the oversold zone and sells when the indicator is coming out of the overbought zone. When the invert is activated it does the opposite.
This Algo trades based on the Envelopes indicator. This Algo places a buy trade when the price crosses above the upper band and sells when the price crosses below the lower band. When invert is activated the algo executes opposite trades.
This Algo trades based on the Heiken Ashi indicator. This Algo takes a buy trade when the indicator changes its color to an uptrend and takes a sell trade when the indicator changes its to a down trend. When invert is activated it takes opposite trades.
This Algo trades based on the Ichimoku cloud indicator as a dynamic support and resistance. This Algo takes a buy trade when the price crosses above the cloud and takes a sell trade the price crosses below the cloud. When invert is activated it takes opposite trades.
This Algo trades based on the Moving Average indicators CrossOver. The Algo takes a buy when the faster moving average crosses above the slower moving average while it places a sell when the faster moving average crosses below the slower moving average. When invert is activated opposite is true.
This Algo trades based on the MACD indicator. This Algo takes a buy trade when the indicator crosses the zero level upwards and sells when the Algo crosses the zero level downwards. When invert is activated, it executes opposite trades.
This Algo trades based on the RSI indicator lower and upper levels. Sells when the indicator is coming out of the overbought zone and sells when the indicator is coming out of the oversold zone.
This Algo trades based on the Parabolic SAR indicator. This Algo places a buy trade when the price crosses above the indicator value and sells when the price crosses below the indicator values. When the invert is activated it places the opposite trades.
This Algo trades based on the 123 chart pattern based on the Zig-Zag indicator and the Zig-Zag indicator by itself. When trading using the 123 patterns it takes a sell trade when the price touches the most recent lowest price and takes a buy trade when the price touches the most recent highest price.
This Algo closes all the open trades at once when activated.
This Algo places StopLoss, TakeProfit and TrailingStop for all open trades when activated.
This Algo trades based on the bullish and bearish engulfing candlestick patterns.
This Algo trades based on the hammer and shooting star candlestick patterns.
This Algo trades based on the morning and evening star candlestick patterns.
This Algo trades based on the morning and evening star candlestick patterns.
This Algo trades based on the piercing line and dark cloud candlestick patterns.
This Algo trades based on the Three Inside Up and Three Inside Down candlestick patterns.
This Algo trades based on the Three White Soldiers and Three Black Crows candlestick patterns.