![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. Motivation.
In this part of article the author said that it is very good that we can backtest EAs in visual mode in Metatrader. Abd he wants to present the way about how to backtest manual trading systems using Metatrader's visual mode without EA creation.
2. Preparation.
So everybody can use Metatrader's strategy tester in visual mode?
Well. First of all you need to download all necessary files to your computer:
- place vHandsTrade.mq4 in \MetaTrader 4\experts\ directory;
- place VisualTestingTools.mq4 file in \MetaTrader 4\experts\include\;
- place two indicators (vTerminal.mq4 and vHistory.mq4) in \MetaTrader 4 Work\experts\indicators\.
And after that compile vHandsTrade EA in MetaEditor. You should not get any errors:
After that you may create template for testin (tpl file). To do that please open any chart, attach vTerminal and vHistory.mq4 indicators and save this template under the name vHandsTrade.tpl:
Please note: you should switch 'Chart shift' option on:
3. Adjustment of EA.
Just spend 5 minutes and adjust the settings of vHandsTrade EA and it will be easy for you to test your manual trading system. So do the following.
You will have control panel on your chart. And using this panel you will be able to select lot size, expiration time for pending orders and so on. Basicly it will looks like this one:
This panel is corresponding to some code in EA (open EA in MetaEditor):
Those parameters are very understandable:
- RISK (Risk) - % from deposit;
- LOT (Lot) - lot size for openning the orders if RISK = 0;
- STOPLOSS (SL) - stop loss value if we are not moving stop loss line on the chart;
- TAKEPROFIT (TP) - take profit value if we are not moving stop loss line on the chart;
- TRAILINGSTOP (TS) - trailing stop;
- EXPIRATION (Exp) - exriration time for pending orders (if you will have pending orders).
You may change anything directly inside the code. For example, if you use the following lot sizes: 1.0, 2.0, 5.0, 10.0 and 50.0 so you may change some line inside the code, for example:
And after compilling EA in MetaEditor once again you will see the following control panel on your chart:
What is SELECTED_LOT, SELECTED_RISK, SELECTED_STOPLOSS, SELECTED_TAKEPROFIT, SELECTED_TRAILINGSTOP, SELECTED_EXPIRATION?
It is value by default.
Do you see red colored figures on the control panel? It is default value. For example:
if int SELECTED_LOT = 1 in the code (see image above) so the fist figures will be default. First figutes in lot size line (1.0, 2.0, 5.0, 10.0, 50.0) is 1. Means lot=1 is default value.
If you want to select lot=5 to be default so change as the following:
[CODE]int SELECTED_LOT = 3;And 3rd figures (5 lot size) will be in red color in control panel:
I think it is neccesary to be adjusted one only, select default values for every parameters inside the code.
4. Starting.
Now open Strategy Tester in Metatrader, select our EA (vHandsTrade), symbol, model 'every tick', period and so on.
Just before pressing 'Start" open 'Expert Properties' and finish with settings:
And you will see the following settings:
- CommentsCount - max number of cumments on the chart;
- SelectedColor - color for Risk, Lot, SL, TP, and so on values;
- ModifyColor - color for modify order on the chart;
- TrailingColor - color for trailing stop on the chart;
- TerminalRows - if TerminalRows = 0 so Terminal will not be refreshed;
- HistoryRows - max rows for 'Account History'. if HistoryRows = 0 so account history will not be re-freashed;
- BigText - big text=true;
- SignalPoints - distance in pips to see stop loss, take profit and price to open the order on the chart, for example if SignalPoints = 10 so stop loss will ve visible when the price will be 10 pips near the stop loss value;
- ShowCancelled - if true so you will see canceled orders in 'Account History';
- ShowExpired - if true so you will see expired pending orders in 'Account History';
- MainColor - color for heading in Terminal, 'Account History' and for balance and equity
- BuyColor - buy color orders on the chart;
- BuyOPColor;
- BuySLColor;
- BuyTPColor;
- SellOPColor, SellSLColor and SellTPColor - just a color on the chart for sell.
All the colors by default are for black chart. If you use write backgroud for your chart so change the color in EA's asettings accordingly.
I guess is already translated![](https://c.mql5.com/forextsd/smiles/shades_smile.png)
https://www.mql5.com/en/articles/1425
https://www.mql5.com/en/articles/1420
https://www.mql5.com/en/articles/1452
Thanks Linuxser.
It saves my time a lot.
I will stop. So, everybody may read the translation (see previous post).
Qustion About Placing Orders
Thanks to Newdigital for the translation, now everything seems clearer!!!
Just one question....I understood that we will manage the orders by modifying the code...is that right?.
Thanks Again.
Please disregard my previous post
Thanks to Newdigital and Linuxuser.
Have a good day.
I am tryng to use this manual backtester but stucked: can not modify the orders.
I am tryng to use this manual backtester but stucked: can not modify the orders.
My view is completely different from the pictures posted by the author.
Also. I have a error log for vHistory and vTerminal: 1;40;;;Start function not found and cannot be run.
And the journal is full with:
2007.01.25 12:58:30 1993.11.24 16:00 vHandsTrade GBPUSD,Daily: ObjectSetText( "Comment_1", "", 8"Arial", 0 ) - Error #4202