Hello Newdigital, how do I use the magic number to tell which EA a trade belongs. I am testing 2 EAs and would like to know which OPEN or CLOSED trades are due to which EA.
Thanks
Jozo
Printable View
Hello Newdigital, how do I use the magic number to tell which EA a trade belongs. I am testing 2 EAs and would like to know which OPEN or CLOSED trades are due to which EA.
Thanks
Jozo
You can use comments for example ... every EA may have dofferent comments and you may see it when EA open trade. On this way - you will know - which EA opens the trade.
Wonderful. Thank you very much. Yes, now it is clear! I spent an entire afternoon and evening reading about magin numbers etc - and could not find a solution!
How to Trade Breaks of Trendlines
The basic points in the video are as follows:
1. When markets break a trendline after forming three steepening trendlines, a larger reversal may be in the works
2. Look for confluence with candlesticks and horizonal support/resistance levels after a trendline breaks
3. Enter on a re-test of a trendline or a broken support/resistance level
4. When there are 3+ trendlines and the market starts to reverse and break each one, pullbacks will likely be steeper after each subsequent break of a trendline
http://youtu.be/P1TnM-UImQc
Money Management and ATR explained
Risk & Money Management are very important, if not the most important issues that must always be addressed by anyone seriously considering trading the Markets. They cater for the preservation of both your Initial & Accumulated Trading Capital. You may already have a great system or set of rules to determine what to buy but if your method of Money Management is clumsy, you will lose money, unnecessarily! Once buying that share your role is no longer as a Trader or investor but a Risk Manager. At some point in time your trading system will meet a draw down period (losing streak) and if you don't know what to do, you will lose your feeling of control and try to desperately trade your way out of this crisis. Many people feel despondent and abandon a perfectly good trading system, or give up trading altogether with large profits still to be made.
http://youtu.be/ZSpl8-5cyxI
How to Trade the 5 Bar Reversal Setup
The basic formula is as follows:
- Wait for five or more bars in the same direction.
- Enter when the market to starts to reverse, but wait until price clears the last bar of the trend being reversed.
- Place your stop below the reversal point.
- Use confluence to determine an exit point.
5 Bar Reversal Buy Setup
The 5 Bar Reversal Buy Set up should be one of the primary tactics in your trading tool box.
This tactic is great for picking up nice gains against the prevailing trend.
This set up is deadly in all time frames ranging from the 5 minute to daily charts.
What To Look For:
- 5 or more consecutive lower highs or red bars.
- The stock trading well below the 20ma. (In any time frame)
- A reversal bar. (bottoming tail or narrow range bar)
- Volume increase.
How To Trade It
- Buy when the stock trades above the previous bar’s high.
- Place a stop directly below the previous days bar or the entry bars low depending on how much risk you are willing to take.
- Look to exit at the 20ma or previous minor resistance area.
Attachment 3147
http://youtu.be/LkUKrgHVzvc
Getting Started With Metatrader4 Trading Platform
Metatrader4 Tutorial - How To Setup MT4 and Trading With Metatrader4 Tools and Charts
The most popular search on Metatrader4 Tutorial is how to save a work space in metatrader4, how to save a trading system/template in MT4. Before starting the tutorial, the screen shot below shows how to save a template/trade system and also how to save a work space in MT4. The same buttons are also used to load the template on another separate forex chart. (click on buttons to get options)
Attachment 3318
The MT4 is part of the online foreign exchange market. The metatrader4 Platform trading software that is installed on a client’s computer.
The screenshot below shows the user interface of the Metatrader4 Platform.
Attachment 3319
The metatrader4 Platform software is installed on a client’s computer and it is intended to do the following:
- Plot graphical Information about exchange rates in the form of a grid/chart
- Receive Streaming exchange quotes from the Forex brokers
- Perform exchange trade operations: Buying and Selling of currencies
- Show the open trade transaction and orders on Platform
- Perform technical analysis on charts
- Testing of trade strategies on Forex demo accounts
- Programming of custom indicators and expert advisors for the purpose of automated forex trading.
- Provide statements of trading history and a summary of profits/losses.
The metatrader4 platform which is also known as MT4, is designed to provide trading tools that can be used by traders to make buy or sell decisions. The MetaTrader 4 platform provides online exchange quotes and streaming data about price movement. This information is delivered directly to the Metatrader4 platform. This information that is delivered in the form of real time quotes is then analyzed on the MetaTrader 4 platform using the technical tools provided for within the MT4 platform.
The metatrader4 platform is a free trading software that is provided for by Forex brokers. You can download the MT4 platform from online broker’s websites, once you download it, you should then install the platform on a computer that has an internet connection and then connect to your broker and start receiving streaming quotes.
The Metatrader4 has different windows and chart panels each designed to deliver a different type of market information, starting with the exchange rate quotes used to plot currency charts to the Market data window, Tool bars for attaching technical indicators to the chart and the main menu bar used to navigate the MT4 software platform.
Installing Metatrader4 Trading Platform
To install metatrader4 you will have to download the MT4 platform, then launch the download, from there an installation wizard appears and all you have to do is to follow the installation instructions. After installation the platform will run automatically just like any other software. You can launch the MetaTrader 4 from the start menu>> Programs or from the desktop shortcut that appears as an MT4 Icon.
Opening of Forex Trading Account in Metatrader4
Metatrader4 Demo Account
Demo accounts enable traders to practice FX trading under real market conditions only that it is done without real money being invested. These types of accounts allow traders to work out and test Forex trading strategies without any risks. These accounts are the same as real account only that they do not consist of any real money investment and traders cannot make profits from these types of accounts
To open a Forex Demo Account
Go to File “At the top left corner of the MT4 platform”
Click “Open an Account”
Attachment 3320
Attachment 3321
Fill these details
- Name - your name
- Country - country of residence
- State - area state
- City - city of residence
- Zip code - zip code
- Address - mailing address
- Phone - contact telephone number
- Email - email address
- Account Type - account type to be selected from the list defined list
- Currency - the basic currency of the deposit
- Leverage - 1:100
- Deposit - the amount of the initial deposit
Then tick “I agree to subscribe to your newsletters”
Then click next.
The platform will then scan for the server.
Attachment 3317
Getting Started With Metatrader4 Trading Platform - continuing
Then click next
Your demo account registration details will be displayed, write them down and then click “Finish”
Attachment 3323
Login to Account
Once you start your MT4 platform you will have to login to your forex demo account, click on file then click login
Attachment 3324
The following window pops up
Attachment 3325
Specify your account number and password, the server you can select using the down arrow. Tick the “save account information” and click login. This is known as authorization, every time before trading you will have to perform authorization.
Section 1: Metatrader4 Platform Menu Bar
Attachment 3326The menu bar has the following menus
- File
- View
- Insert
- Charts
- Tools
- Window
- Help
File Menu
The metatrader4 file menu has the following commands, these commands are used used for working with the charts and navigating the MT4 platform.
- New Chart - opens a new chart window for the currency pair symbol chosen.
- Open Offline - open a chart offline form the charts history.
View Menu
View menu has Commands for managing tool-bars and the MT4 interface. The view menu has also the activate/deactivate buttons for chart windows.
Tool bars - Active tool bars are checked. To activate/deactivate a toolbar click on the tool-bars arrow, then tick/untick the toolbar you want to activate/deactivate.
Status Bar – button to enable/disable status bar located in the lower part of the metatrader4 platform. This bar shows the connection to the server. Green triagled bar for platform is connected, red triangled bars for no connection. This bar also displays the active profile, if any, and also prices of the currencies. By right clicking on this bar you can save a profile.
Charts Bar – this button is to enable/disable the chart window that shows currency pairs names bar located below the chart graph. By using this bar a trader can switch among open charts easily.
Market Watch - opens/closes the window displaying currency quotes in streaming format. Shortcut keys Ctrl+M
Navigator — - opens/closes the window that displays information about accounts and the indicators. Shortcut keys Ctrl+N
Terminal - opens/closes the window for managing trading orders, account trading history, news, e-mails, journal of events. Shortcut keys Ctrl+T
Insert Menu
This menu is a collection of objects that can be super-imposed on the Forex chart. These are line studies, technical indicators, arrows text boxes.
"Indicators" sub-menu – list of all indicators
"Line Studies" sub-menu – list of all line studies, channels, Gann tools, Fibonacci tools.
The following shapes can also be attached on the Forex chart.
- Shapes — geometrical figures (rectangle, triangle, ellipse) that allow to select various areas in the chart;
- Arrows - symbols like arrows, check signs, stop signs, price signs that mark areas of resistance, support or breakout.
- Text - adding of text for comments on the chart, these are then fixed and move with the chart as it is scrolled.
- Text Label - adding of text for comments on the chart, these are then not fixed and will not move with the chart as it is scrolled.
Charts Menu
This menu contains a collection of commands for managing the trading chart and technical indicators super-imposed on the chart
- Indicators List - window sub-menu for managing indicators imposed in the forex chart, by clicking this window the full list of indicators imposed on the chart will appear as list on this window. Shortcut key Ctrl+I
- Objects – sub-menu for managing super-imposed objects. A trader can select all object attached to a trading chart including line studies, signs, shapes, and texts and can select to modify or delete them.
- Bar - display as a sequence of bars. Shortcut Keys Alt+1
- Candlesticks - display as a sequence of "candlesticks". Shortcut key Alt+2
- Line - display as a line chart connecting close prices of bars.
Shortcut key Alt+3- Foreground Chart - puts the chart as the foreground and places the indicators and line charts behind this chart, they will appear behind.
- Periodicity- chooses the time frame, from a sub-menu that will appear where the chart time frame can be selected
- Template- the template sub-menu is for saving a trade system, and also loading the same trading system on a different chart. By saving a system you can save time instead of putting indicators on new chart every time. You can also add or delete templates from this menu.
Tools Menu
This menu can be used to change setting of the metatrader4 platform, using the following commands.
- New Order – a trader can place a market order or a pending order from this window
- History Center – the quotes used for plotting of charts can be edited in the History Center.
- Global Variables — call the window containing the list of the terminal global variables.
- MetaQuotes Language Editor – Meta Editor is for one can creating and editing expert advisors, custom indicators and scripts.
- Options – a trader can change settings for the connection, trades, charts, object, expert advisors and email on this window. Shortcut key Ctrl+O.
Window Menu
This menu contains a collection of commands for managing the chart and the way they are arranged in the metatrader4 workspace.
- New Window – a new chart window can be opened from here, by clicking this button and a list of sub-menu will open containing a list of currency pair symbols available. Select a symbol name from this list to open the corresponding chart.
- Cascade - arrange the chart windows in a cascade
- Tile Horizontally - arrange the windows horizontally
- Tile Vertically - arrange the windows vertically
- Arrange Icons - arrange windows minimized. Minimizes and locates all open charts in the lower part of the workspace. This is used when a trader works with a number of Forex charts at the same time.
Help Menu
The Help menu is for documentation to refer about the working and execution of the metatrader4 platform. This menu has the following:
- Help Topics - inbuilt help files containing a user guide of MetaTrader4. All settings and functions of the MT4 are described here. Shortcut Key F1 button.
- About - About window is for information about the company, its contact details, and the metatrader4 version
Section 2: Metatrader4 Platform Toolbars
Attachment 3322
Getting Started With Metatrader4 Trading Platform - continuing by this one
Standard Toolbar
Toolbar containing general commands for managing the metatrader 4 MT4 platform.
Charts Toolbar
Toolbar containing commands for management of charts and other technical indicators super-imposed on the charts.
Line Studies Toolbar
Toolbar containing commands for managing of line studies super-imposed on the charts.
Periodicity toolbar
Toolbar containing commands for changing the periodicity of the time-frame of the Forex trading charts.
Customizing Tool bars
Sometimes you the button you are looking for might not be on the toolbar, in which case you will need to customize the toolbar using the customize button.
Attachment 3328
The Customize button allows a trader to assign a new button to any toolbar.
Attachment 3327
On this new window containing the list of toolbar elements available. A trader can "Insert" and "Remove" buttons to the tool bar, using the insert/remove buttons. A trader can also arrange an item on the toolbar either UP or DOWN using the "Up" and "Down" buttons for defining the location of a button on the toolbar. A trader can also reset the toolbar to the default using the reset button.
A toolbar can also be dragged to any place on the trading platform by clicking the customize button and moving the mouse while still holding down the mouse key.
Metatrader4 Platform Charts Metatrader4 Platform Indicators
Section 2: Metatrader4 Platform Windows
Market Watch Window
The currency pairs symbols for which the Metatrader4 platform displays quotes from the server are listed in the "Market Watch" window. The data are represented in this window show The "Symbol" field contains the currency pair name and the fields of "Bid", "Ask", and "Time" that shows the corresponding prices and time of their streaming from the server.
This window allows a trader to place market orders and pending trading orders and open new charts. A trader can right click the mouse button within the "Market Watch" over the currency pair symbol and a menu containing the following commands appears.
New Order - this opens the "New Order" trading window where a trader can place a market order or a pending order for the currency pair symbol selected. The "New Order" window can also be opened by double clicking on the currency symbol name in the "Market Watch" window.
Chart Window - open the chart of the symbol selected.
Tick Chart - open the tick chart of the symbol selected. Unlike normal charts, the tick chart is located directly in the "Market Watch" window.
Hide - hides the currency pair symbol from the list. To minimize the bandwidth downloaded by the metatrader4. Hiding currency pairs not traded conserves bandwidth for the Forex trader. This can save money if you are using dial-up connection.
Data Window
This window is for displaying price information Open High Low Close,OHLC , the date and the time of the price bar, and the indicators used on the price chart. The "Data Window" is an information window for information display only. Information about a certain price bar and the super-imposed indicators can be obtained from these data window.
A trader can
- Copy - copy data from this window into the clipboard for future reference
- Show - show/hide information fields about the prices bars, the OHLC, date and volume can be selected in the sub menu from clicking the show button. The items that have been checked will be shown.
Navigator Window
This window allows to get a quick access to various features. This window can be opened/closed by pressing accelerating. Shortcut keys of Ctrl+N.
This window has a list of features
- Accounts - this group includes the list of open accounts, a trader can open a new demo account by clicking “Open an Account”or delete one.
- Indicators - this group includes the list of built-in technical indicators, the tools for analyzing the price movement. Double clicking will Attach an indicator to a chart, a trader can also draf and drop an indicator on the Forex chart to attach it.
- Expert Advisors – this group contains the list of all available expert advisors. Expert Advisors in the metatrader platform are software programs allowing the automatic execution of trades.
- Custom Indicators – This group includes a list of all custom indicators, you can also download an indicator and install it on MT4 and it will appear under “custom indicators”.
- Scripts - Scripts are programs executed only once when activated, these scripts for example can close all open trades with one single mouse click.
Terminal Window
Trade Tab
The "Trade” tab is the tab that contains information of the current status of the trading account, this includes, open positions, pending orders that have been placed. Open positions can be arranged and sorted using any field within this table.
Open Positions appear above and the pending orders below them, when pending orders are executed they then change from pending orders to active orders, This tab also show account balance and financial calculation of profit and loss of the current open trades.
All the open trades are displayed as a table that has the following fields from left to right
- Order - the trade number, unique number of the trade
- Time - time of position opening, represented as YYYY.MM.DD HH:MM or year.month.day hour:minute.
- Type - type of the trading operation. Buy, Sell, and pending orders, Sell Stop, Sell Limit, Buy Stop and Buy Limit.
- Lots - the amount of lots of open trades.
- Symbol – displays name of the currency pair.
- Price - the price at which the trade position was opened
- S/L - the placed Stop Loss order level. If this order has not been set, a zero value will be shown in this field.
T/P - the placed Take Profit order level. If this order has not been set, a zero value will be shown in this field.- Price - the current price of the currency pair
- Commission — commissions charged by the broker
- Swap – interests charged or paid to a trader
- Profit – Profit of the trade transaction, a minus value is a loss
- Comments — comments on trade operations can be placed here.
On this window a trader can view the open positions , placed orders, and can also manage trading activities. A trader can:
- Open a new position,
- Place a pending order
- Modify or delete a pending order
- Close a position.
The following commands can be executed to perform these operations:
- New Order - A new position can be opened using this button and a market/pending order can be placed. To place an order a trader must specify the currency pair, amount of lots, order type (market order or pending order) and the Stop Loss and Take Profit levels.
- Close Order - closes a trade position. This command closes the selected positions.
- Modify or Delete Order - changes the "Stop Loss" and "Take Profit" values of open positions or the pending order price level. If Stop Loss and Take Profit levels are set too close to the current price an error message will appear, and the levels will not be executed the values changed should not be close to the current price and should be at least 10 pips away.
- Trailing Stop - places, modifies, or deletes the "Trailing Stop" level.
- Profit - shows profit/loss as points, as term currency, or as deposit currency. A Forex trader can change the method to show profits by right clicking on this table field.
- Commissions - shows/hides the "Commissions" column.
- Comments - shows/hides the "Comment" column. Comments can be attached to the trade operations
- Auto Arrange - automatic arrangement of columns
- Grid — shows/hides grids to separate the columns.
Account History Tab
This tab contains information about a history of all trading operations. The entire trades history is displayed in form of a table with the following fields from left to right:
- Order - the unique number of the trade
- Time - time of position opening, represented as YYYY.MM.DD HH:MM or year.month.day hour:minute.
- Type - type of the trade operation. Buy, Sell, and pending orders, Sell Stop, Sell Limit, Buy Stop and Buy Limit.
- Lots - the amount of lots of open trades.
- Symbol – displays name of the currency pair.
- Price - the price at which the trade position was opened
- S/L - the placed Stop Loss order level. If this order has not been set, a zero value will be shown in this field.
T/P - the placed Take Profit order level. If this order has not been set, a zero value will be shown in this field.- Price - the current price of the currency pair
- Commission — commissions charged by the broker
- Swap – interests charged or paid to a trader
- Profit – Profit of the trade transaction, a minus value is a loss
- Comments — comments on trading operations can be placed here.
Context Menu
The context menu contains Commands a trader to manage the history range and data performance and data export, these menus can be found by right clicking on the history trades area, these commands are:
- All History - shows the entire account history.
- Last 3 Months - show only the last 3-months history
- Last Month - show only the last month history
- Custom Period - show history for the selected period.
- Save as Report - saves the account history as a HTML file, the file can be saved anywhere you specify on the computer.
- Save as Detailed Report — save the account history as a detailed HTML file, this will save the file anywhere that you specify on the computer
- Commissions — shows/hides the Commissions column;
- Comments — shows/hides the Comments column.
- Auto Arrange — automatic arrangement of columns.
- Grid — shows/hides the grid for separating of columns.
News Tab
The News tab lists a list of incoming news that are streamed from the Forex broker, the news topics are displayed as a table and arranged according to the time of incoming. The news incoming time, its topic and its category are published on this table. This news list is updated automatically as latest news is streamed from the Forex broker.
Alerts Tab
The Alerts tab contains information about the created alerts. This alerts are intended for signaling about the specified events in the Foreign exchange market. Having created trading alerts, a trader can leave the monitor as the metatrader 4 platform will automatically inform the trader about the server event through a sound alert.
All alerts in this metatrader 4 tab are represented as a table with the following fields:
- Symbol - Name of currency pair to set up alert for
- Condition - paramete under which the alert will trigger. The following are the trigger parameters that can be set:
- Bid> - If the current Bid price exceeds the set value, the alert will trigger.
- Bid< - If the current Bid price is lower than the set value, the alert will trigger.
- Ask> - If the current Ask price exceeds the set value, the alert will trigger.
- Ask< - If the current Ask price goes below the set value, the alert will trigger.
- Time= - if time is equal to the set value. As soon as this time reaches, the alert will trigger.
- Counter - the number of alert triggers;
- Limit - maximum allowable amount of the alert triggers. Having triggered this given number of times, the alerts will stop to trigger.
- Timeout - period of time between alert triggers.
- Event - the action to be performed, either this can be setting audio signal, setting a file execution or a sending a message by email.
Alerts Management
The following context menu commands are available for managing of alerts, these can be found by right clicking anywhere within the Alerts widow.
- Create - creates a new alert.
- Modify - edits an alert.
- Delete - deletes an alert.
- Enable On/Off - enables/disables an alert. The alert will not be deleted but it will stop to trigger. This alert can be enabled later.
- Enable – switch an alert on/off. "Enable On/Off" Alert command
- Action - assigns the action to be performed when an event happens example playing of a sound, running a file, or sending an email.
When specifying playing a sound or running a file a trader should also specify the corresponding files. For sending of an email message the trader should specify the subject topic and text of the message to be sent.- Symbol — currency for which alert is to be set for.
- Condition — condition ("Time=", "Bid<", "Bid>", "Ask<", "Ask>") parameter for which the alert will be triggered
- Value – checking the value of the parameter set. For example, If the market price is equal to this set value, the alert will trigger.
- Source – source of the alert.
- When a sound is played or a file is run the trader should specify the path to the corresponding file.
- When a message is to be sent by email one should input the message and the trader should also set up the email parameters for sending message.
- Timeout - the amount of time between alert triggers.
- Maximum iterations - maximum amount of times the alert should repeat the trigger.
The "Test" button allows the trader to check the usability of the selected trade alert. For the set changes to come into effect, a trader must press the "OK" button.
Tutorial 1 - MetaTrader 4 Tips and Tricks
MetaTrader 4 is an extremely robust and efficient way to manage your investing. This video will demonstrate some of the platform features and will help you understand how you can start to customize the platform for your own trading. I will cover the following topics in the video.
1. Exchange rates are quoted to the 5th decimal for most forex pairs and to the third decimal place on JPY quoted pairs. This allows Alpari to offer tight spreads and to increase pricing transparency. The market watch window, account reports, order entry screens and charts will all display quote information this way.
2. The charts in MetaTrader 4 will auto scroll by default to show the most recent price action. However, when you are doing specialized analysis, you may want to turn this feature on and off. In the video I will show you how to adjust this feature.
3. The bid price is shown on the charts but depending on the pair and your trading style you may want to be able to see the ask price as well. In the video I will show you how to add the ask price to any forex pair's chart.
http://youtu.be/1DWqUZTbG0A
Tutorial 2 - MetaTrader 4 Trade Window
Entering a trade is the most critical function a forex investor can perform on the MetaTrader 4 platform. This video presentation will provide all the background you need to make sure you understand how the trade tab works and some tips for making the most efficient use of the platform. I will cover the following topcis.
1. How to adjust your trade size from micro to full 100K lots.
2. Monitoring your pending orders and advanced order entry functionality including trailing stops, stop losses and take profit levels.
3. What the "maximum deviation" function is and how to use it during extreme market volatility.
http://youtu.be/vyZtp_T9oCs
Tutorial 3 - MetaTrader 4 Platform Management
Monitoring your account over the long term is a critical way to understand what you are doing well as a trader and what you may need to work on. The account reporting tools in MetaTrader 4 are easy to access and to use. This presentation will answer some of the most important questions users have about the account management and reporting tools including the following topics.
1. Using the trade reports and account history tabs and customizing the information to suit your own personal style.
2. Changing system passwords for your security and convenience.
3. How to make your work more efficent by creating and using chart templates and platform profiles.
http://youtu.be/2xWETxJmLAM
Tutorial 4 - MetaTrader 4 Indicators and EAs
Two of the most exciting features on the MetaTrader 4 application, especially for advanced users, is the ability to create and install custom indicators and expert advisors. This presentation will cover some of the basics for installing an indicator or expert advisor and how to make sure they are applied correctly.
1. Downloading and installing a custom indicator.
2. Downloading and installing an expert advisor.
3. How to tell if your expert advisor or custom indicator is attached to the chart correctly and activated.
http://youtu.be/0jliK2z7j-A
Expert Advisor - Expert Advisor Testing and Optimization
To get the most out of your expert advisor, you'll need to optimize and backtest your strategy using MetaTrader's Strategy Tester. While forward testing on a demo account is essential, backtesting allows you to simulate trading over a long period of time in just minutes. And with the optimization feature, you can find out which settings performed best over a selected historical chart period.
There is considerable debate over the accuracy of MetaTrader's strategy tester. At best, backtesting offers only a close approximation of how trades would be executed in real-time. But it's the only tool available to rapidly test any strategy over a wide range of trading situations, and one that you should learn how to use well.
Open the Strategy Tester in MetaTrader by clicking the appropriate button on the toolbar or by selecting Strategy Tester from the View menu.
History Center
Before backtesting or optimizing, it's important to make sure that your history data is complete and accurate, especially if you're using 'Every tick' as your testing model. If you see 'mismatched chart' errors in your Journal log or if your modeling quality is less than 90%, your history data is insufficient to generate accurate ticks.
Open the History Center from the Tools menu or by pressing F2 on your keyboard. Double click the chart pair in the left column that you plan to backtest for. A list of time periods will appear below. Start by double clicking on 1 Minute (M1) to load the history data for that period. The backtester uses M1 data to generate ticks, so it is important that your M1 data is complete.
From the History Center, you can download or import data to use in backtesting. Your broker will automatically provide some recent data, but it may not be enough for a longer backtest. In addition, the free downloadable data from MetaTrader (accessible via the Download button) is not always complete, and can contain large gaps.
First, select the M1 period for the symbol from the list on the left-hand side. Click the Import button, and then click Browse in the Import dialog to select the M1 data file you just downloaded. Press OK to import the data -- it may take several minutes. You now have several years of M1 data for that symbol.
To make use of this data on higher timeframes, you'll need to use the period_converter script that comes with MetaTrader. Open a chart window and set it to M1. Drag and drop the period_converter script from the Navigator window onto the chart, and set the ExtPeriodMultiplier setting to the number of minutes to convert to. For M15, use 15; for H1, use 60; for H4, use 240, and so on.
Repeat this process for all of the symbols/periods you plan to test on. Once you have sufficient history data, you can begin testing.
Optimization
The optimization feature of MetaTrader 4 allows you to test thousands of combinations of expert advisor settings to find the most profitable settings for the selected chart, period and date range. Indicator-based strategies will need to be optimized for maximum profitability. However, almost all EAs will benefit from optimization - even those that trade on tick data, provided you have complete M1 history data (see above).
While the optimizer will return the most profitable settings for the selected date range, this is no guarantee that these settings will be profitable in the future. Market conditions change often, so it is important to regularly re-optimize your expert advisor for best results.
To optimize your expert advisor, first select it from the Expert Advisor drop-down box. Select the currency pair from the Symbol box and chart period from the Period box. For Model, you'll generally want to select "Open Prices Only," unless you are optimizing an EA that runs on tick data. In that case, select "Every Tick." Check the Use Date option and select a range of dates to optimize for. Lastly, make sure that Optimization is checked.
Click the Expert Properties button to open your expert advisor settings. Under the Inputs tab is where you'll enter the range of values to optimize for. The Start column will be the lowest value for a given setting, while the Stop column will be the highest. The Step column is the amount that the optimizer will "step through" from the Start to the Stop setting.
http://www.easyexpertforex.com/expert-settings.jpg
In the image above we are optimizing SL, TS and TP settings for an expert advisor. The Start value is 20, the Step is 20, and the Stop is 200. The optimizer will test every combination of values from 20, 40, 60 and so on up to 200. Use a start, step and stop value that is appropriate for the setting you are optimizing. Even values (5, 10, etc.) are good.
The checkbox to the far left must be selected for that setting to be optimized. Any settings that aren't checked will use the number in the Value column when optimizing. Under the Testing tab, you can adjust the Initial Deposit to something a bit more realistic. Leave the other settings at their defaults.
When you're ready to begin optimizing, hit the Start button at the bottom right of the Strategy Tester window. Depending on the period, the date range, the testing model and the number of settings to be optimized it can take anywhere from a few minutes to several hours. If it's taking too long, consider shortening the date range, optimizing fewer settings, or using a larger step value.
http://www.easyexpertforex.com/optimization-results.jpg
Once the optimization is finished, open the Optimization Results tab and double-click the Profit column to sort the results. Double-click any of the results to load it into the tester. Hit the Start button again to backtest with the selected settings.
Backtesting
By now, it should be obvious how the backtester works. Select your Expert Advisor, Symbol, Period and Model, check the Use Date box and select a date range. Select Visual Mode only if you want a visual walkthrough of the backtesting. Leave Optimization unchecked.
Hit the Expert Properties button and enter your settings in the Value column under the Inputs tab. You can also load or save settings using the buttons in the bottom right. The Start, Step and Stop columns are ignored, as are the checkboxes.
Close the Expert Properties dialog and press Start to begin testing. It will take anywhere from a few seconds to several minutes depending on your settings. Once testing has finished, open the Report tab on the bottom to see your results.
http://www.easyexpertforex.com/results.jpg
A few statistics to take note of:
- Total net profit - The Gross profit minus the Gross loss.
- Profit factor - The ratio of gross profit to gross loss. Higher is better, anything above 1.5 is good.
- Absolute drawdown - The drawdown of your initial deposit. High drawdowns increase the likelihood that your account will be blown out.
- Profit trades - Your overall win percentage.
- Modeling quality - Only important if your testing model is Every Tick. If so, this should be at 90%. If not, follow the instructions above to update your history with accurate M1 data.
The Results tab at the bottom of the strategy tester will give you the details on opened and closed orders, including trailing stop, take profit and stop loss. Click the Open Chart button to get a visual representation of your results. When testing your new EA, examine these closely to ensure that your strategy is working as intended.
Walk Forward Analysis
While backtesting and optimization can give you a good idea of how your EA will trade, you will need to do more extensive testing to ensure that your trading system is truly profitable. The best way to achieve this is by a process called walk-forward analysis.
Walk forward analysis simply consists of multiple cycles of optimization and backtesting, and analysing the results of testing over a long period.
http://youtu.be/nvJYGVL6fuA
Mql4 Lesson 1
In this lesson we will learn the differences between an ex4 file and an Mq4 file.
What the #property copyright is about.
The different way to put notes into your EA in the form of comments.
We will learn about the init() deinit() and start() functions and when they run.
http://youtu.be/n8fZINmSv0g
Mql4 Lesson 2
In this lesson you will learn what extern does to variable. We will also cover the data types of Int, double, string, bool, color and datetime.
Not only do I define them but also show you how to use them in your code.
http://youtu.be/mE3YdyF3j60
Mql4 Lesson 3
http://youtu.be/Xx_EVaaimYQ
Mql4 lesson 4
In this lesson we make our first EA HELLO UNIVERSE!!! You will learn how to use the Comment() function along with Period() and Symbol() and some keyboard shortcuts as well.
http://youtu.be/VePJSWf0AsY
Mql4 lesson 5
In this Lesson we will learn the difference in the ways that an Expert Advisor, a Custom Indicator and a Script run when you attach them to a chart. We also learn how to use the Print() function to troubleshoot our code and what the #property show_confirm and #property show_inputs do.
http://youtu.be/EtIhUnrQA4U
Mql4 lesson 6
In this video we learn how to use the MessageBox function and some other functions including....Symbol()...... MarketInfo()...... and DoubleToStri().........
http://youtu.be/OPtUSJ0L7a4
Mql4 lesson 7
It explains in very simple turns what a function call is and how it's done.
http://youtu.be/vS31rxXO_H4
Mql4 lesson 8
In this lesson we write several functions, and to demonstrate how one function calls another and the flow of information back and forth from Start() to the other functions and back. We also examine the "switch" operator and how it works.
http://youtu.be/vgsbL8QYTeA
Mql4 lesson 9 Part 1
This is the first video in a series where we make a self-adjusting Moving Average using the MaAdjuster() function we made in video 8, We will build it one line at a time explaining all the terms and functions as we go.You will learn how a moving average is really drawn on your chart and also all about the arrays that are created when you open a chart and what they do.
http://youtu.be/NrpKKayVkjY
Mql4 lesson 9 Part 2
This is part 2 of lesson 9. In this video we continue to build our Auto_Adjust_Ma. In this lesson we will Learn how to create an Array and setup our Index that will actuallly draw the line on the chart. We will learn about SetIndexBuffer, SetIndesDrawBegin, SetIndexStyle,SetIndexlabel. Also we learn about drawing arrows and what windings are.
We explore the iMa() function and put it together one parameter at a time.. finally at the end I explain the difference between the 'Ma_Shift' and the 'Shift' settings in the iMA() function. There are only a few lines of code left to write, but alot of explaing to do about them... enjoy...
http://youtu.be/H5BYc0VMJ8k
Mql4 lesson 9 Part 3
In this video we finish making the Auto_Adjusting_Ma. You get a story about losing your marbles and a new way to use a telephone... All of the mystery of the 'for' loop is demistified.. and what the heck is this IndicatorCounted() thing for
http://youtu.be/itfBRhu3p8g
Mql4 Lesson 10
http://youtu.be/ny6qFnPyauo
Mql4 Lesson 11
In this video we create a couple of functions in our EA and we make one called IsNewCandle() to control how often our code runs.. also it is explained what a 'static' variable is and why and when you would want to use one. Hope you learn something that you can use from it..
http://youtu.be/6VtsbeC_z-4
Mql4 Lesson 12
In this video we will put the MoveToBreakeve() function into our Ea and also discuss what 'conitnue' means in a for loop. As you will see, it does not mean what you would think.
http://youtu.be/2wsDjZFGCgA
Mql4 Lesson 13
In this video we write a function that will control a trailing stop for us..
http://youtu.be/IT2WinT4yjY
Mql4 Lesson 14
In this video we improve our ordersend funtion to allow user to enter a stoploss or takeprofit of zero it they want. Also there are two step process necessary to place an order with a stoploss and takeprofit on an ECN broker's server.
http://youtu.be/Kj6vhOQlSfg
Mql4 Lesson 15
This video shows you how to set yourself up a myfxbook account and set your EA so that it will publish to an account there.
http://youtu.be/vkXr-CRmlgo
Mql4 Lesson 16
In this video I give a tutorial on how to set up and use the Alert function in Metatrader and then walk you through the code that we used to make this JimDandy Alarm
http://youtu.be/RYac3soUq6g
Mql4 Lesson 17
http://youtu.be/DFYjqg5KOl8
Mql4 Lesson 18
http://youtu.be/OnKSzLzZNO0
Mql4 Lesson 19
http://youtu.be/SVofW9hN4gc
Mql4 Lesson 20
Quote:
In this video I demystify what the stochastic level really is and show how to use it in an EA. You may be surprised at how simple it is. Just another kind of bait to fish with
http://youtu.be/eazGGTklSKY
Mql4 Lesson 21
Quote:
We make an EA that uses the Macd Signal in combination with the Stochastic Signal and I show you how to incorporate signals from larger time frames into your code.
http://youtu.be/uWctgs2rd6c
Mql4 Lesson 22
http://youtu.be/W3FisYodBXI
Mql4 Lesson 23
In this video I work on an EA that someone sent me to be fixed. It's my hope that by watching me go through the process that you might be able to find the problems with your own EA's that you have coded.
http://youtu.be/I3p31Nlmho8
Mql4 Lesson 24
http://youtu.be/VVZ7kDYa1SE