MT4 navigational tips and techniques
(NEW MATERIAL IN RED TYPEFACE)
Hi all
The following post used to be a sticky in the MetaTrader forum, but it appears to have been lost. Hence I'm re-posting it here.
Use of the mouse and mousewheel, and their keyboard equivalents
Scrolling the chart
Hold down the left mouse button and drag the mouse in the main chart area, to scroll left/right.
Or you can also simply roll the mousewheel down/up, or use the left/right arrow keys, to likewise scroll the chart view left/right.
To scroll a whole screen at a time, use Page Up (scroll left) and Page Down (scroll right).
To reposition to the leftmost bar on the chart, press Home.To reposition to the most recent (rightmost) bar, press End.
To step forward one bar at a time, press F12.
To step backward one bar at a time, press Shift-F12.
Scrolling a chart beyond the leftmost bar will add historical bars to the beginning of the chart, until no more are available from MT4's historical database.
Moving directly to a certain date/time
To re-position immediately to a certain date, press Enter, then type in the date in the form DD.MM.YY and press Enter again. Leading zeros can be omitted (e.g. to move to 4 July 2005, type 4.7.5). To re-position to a certain date/time, use the format HH:MM or DD.MM.YY HH:MM (e.g. to position to 8:07am TODAY on a 1-min chart, simply type 8:7).
You can also use the "Fast Navigation Box" to change either the currency symbol, or the period, thus:
Vertical zoom and re-scale
You can re-scale the chart vertically by moving the mouse into the vertical axis area at the right of the screen, and then dragging downwards (with the left button held down) to compress the chart bars, or dragging upwards to expand them.
Double click to reset the chart to its original scale.
Horizontal zoom and re-scale
Similarly, you can adjust the width of the price bars by moving the mouse into the horizontal axis area at the bottom of the screen, and then dragging right (zoom in) or left (zoom out). Or simply use the "+" and "–" keys to achieve this.
Indicators
Double-click on or near indicators with the left mouse button, to call their parameter setup windows.
Right-click to call the indicator's context menu.
If the screen is cluttered with overlapping indicators and/or objects, making it too difficult to select the desired indicator, press Ctrl-I to call up the Indicators dialog window. Double click (or click the Edit button, or Alt-E) on the indicator to edit its properties (parameters, colors, etc), or click the Delete button (or Alt-D) to remove it from the chart.
You can use the Home, End and Page/arrow Up/Down keys to navigate up/down the list.
Objects
Double-click on or near an object (line studies, texts, arrows, geometric shapes) to select the object. Once selected, you can move an object by left clicking on it (or in the case of or trendline or shape, it's center handle) and dragging it to the desired destination. Shapes, trendlines, channels etc may be extended by dragging the handles on the relevant edges. The number "X/Y" appears, where "X" = the width of the shape in candles, and "Y" = the height of the shape in pips.
Right-click on a selected object to open its context menu.
If the screen is cluttered with overlapping indicators and/or objects, making it too difficult to select the desired object(s), press Ctrl-B to call up the Objects dialog window. Left click the check boxes on/off to select/deselect relevant object(s). Double click (or click the Edit button, or Alt-E) on an object to edit its properties (parameters, colors, etc), or click the Delete button (or Alt-D) to remove it from the chart. To quickly delete a whole block of objects, repeatedly press Alt-D or hold it down (careful, they disappear rather quickly!)
You can use the Home, End and Page/arrow Up/Down keys to navigate up/down the list.
Click on the 'Name' or 'Description' heading area to sort by name, or description, respectively.
Left-click to select an item. You can use Ctrl-click to add individual items to a selection, Shift-click to add a group of consecutive items, or press Ctrl-A to select all items. Then click the Edit button (or press Alt-E) to edit all items in the group consecutively, or the Delete button (or press Alt-D) to delete all selected items simultaneously (careful!).
Alternatively, from the chart window, press Backspace repeatedly to delete the most recently added object(s) on a last-added-first-removed basis (useful if you want to quickly check out a Fibo or regression channel, then remove it). Then press Ctrl-Z to undo any accidental deletes, in reverse order.
Or press the Delete key to remove ALL SELECTED objects.
Parallel Trendlines
Ctrl + left click on a selected trend line to draw a parallel trend line (create a channel). Can also be used with vertical and horizontal lines.
Duplicating objects
The 'Parallel Trendlines' concept extends to ALL objects (vertical, horizontal and trend lines; shapes - triangle, square, ellipse; text and labels; arrows and symbols; and studies like channels, Fibo, Gann, Pitchfork, etc). Here's how to duplicate any object:
-- Select the object by clicking on it**
-- While holding down the Ctrl key: move the mouse over any one of the object's handles, and, holding down the left button drag the mouse to where you want the duplicated object to be located
This shortcut also duplicates all of the proprties of the parent object, e.g. if you have red, green and blue objects, and you want to create a green one, simply duplicate it. This is quicker than creating a new object, and then changing its color to green.
** Object selection options
Press Ctrl-O and then select the 'Objects' tab.
-- "Select object by single mouse click" - if checked OFF, you must double click to select an object, and right click to modify its properties. If checked ON, single click to select an object, and double click to modify its properties.
-- "Select object after creation" - if checked ON, any object is automatically selected immediately after you create it.
-- "Show properties after creation" - if checked ON, the property modification window for the object is displayed, immediately after you create the object.
OR
Press Ctrl-B to display the objects list. Click on the checkbox (at left) for each object you want selected.
Information Bubble
Hover the mouse cursor on or over an element, object or indicator to see the prompt (help information bubble).
Crosshair mode, and ruler tool
Click the mousewheel to switch cursor to the "crosshair" mode.
This can also be achieved by pressing Ctrl-F, or selecting the crosshair icon from the toolbar. The crosshairs also display vertical (price) and horizontal (date/time) co-ordinates at the right and bottom of the chart.
Simply left-click to exit crosshair mode.
Now, here is something extremely useful that I haven’t found in the on-line help:
While in crosshair mode, hold down the left mouse button and drag the mouse to obtain a ruler-type tool that measures vertical (number of pips) and horizontal (number of bars) from the center of the crosshairs. The tool displays counters in the form "A/B/C" where A is the number of bars right or left of the crosshair, B is the number of pips from crosshair to cursor, and C is the price at the cursor.
I find "B" extremely useful for measuring the number of pips between any two points, thus:
1) move the mouse to the point you want to measure from (the "anchor" point);
2) click the mousewheel to enter crosshair mode;
3) then hold down the left button and move the mouse to any number of destination points, to see the number of pips between the anchor point and the current mouse destination.
This saves having to calculate this distance manually, as the difference between two prices. Pretty cool!
You can also use this facility to count price bars (reading "A") between any two dates/times.
Reference and anchor points
'Fixed chart position' arrow: At the lower left of the chart there is a dark colored** arrow. Dragging it with the mouse sets the reference (anchor) point for the chart. Now when you zoom in or out, or even change the timeframe, this point remains anchored at its existing location.
'Chart shift' arrow: At the upper right of the chart there is likewise a dark colored** arrow. Drag it left or right with the mouse to set the location for the last (most current) bar on the chart (i.e. set the amount of empty "whitespace" at the right of the chart).
[** the color is actually set to the same color as the Grid color (press F8 to change the Grid color in the chart Properties window). Hence if the arrows are difficult to see, change the Grid color to a color that contrasts better with the chart background.]
Removing all indicators and objects from your chart
Load a blank chart (the pair/timeframe doesn't matter), then change the settings (press F8) to set colors, grid, etc to suit your preference. Then save this as a template named (for example) Z. (menu option: Charts > Template > Save Template……)
Then, whenever you want to instantly remove all indicators and objects from your chart, simply load template Z, by quickly using the hotkey combination: Alt-C T Z
The 'Grid' and 'Volumes' color selections (obtained by pressing F8 to summon the chart Properties window) each serve dual purposes. The Grid color doubles both as the color for the chart grid (press Ctrl-G to toggle the grid on/off), but also the color for the horizontal Bid price line. Hence if you don't want the Bid price line cluttering your chart (e.g. it's easily confused as another S/R line), and you never use the grid facility, then set the Grid color to 'None', and the Bid price line disappears. I use the Bid/Ask line indicator that I've attached to this post, instead. You can of course turn the Ask line off either by setting the 'Ask line' color to 'None', or by unchecking 'Show Ask line' on the Common tab.
The 'Volume' color selection doubles both as the color for volume bars (press Ctrl-L to toggle these on/off) and also as the color for the order entry level lines. Hence if you don't want these lines cluttering your chart, and you don't use the Volume facility, then set the 'Volume' color to 'None', and the order entry level lines will disappear. Of course you can suppress the displaying of SL and TP level lines by changing the 'Stop Levels' color to 'None'.
List of hotkeys
There are many other useful hotkeys. Here is a comprehensive list:
Left arrow — scroll chart to the left;
Right arrow — scroll chart to the right;
Up arrow — quickly scroll chart to the left or (if the scale is defined), scroll chart upwards;
Down arrow — quickly scroll chart to the right or (if the scale is defined), scroll chart downwards;
Numpad 5 — restores chart vertical scale to its original default. If the scale was defined, this returns the chart back to its visible range;
Page Up — scroll a whole screen to the left;
Page Down — scroll a whole screen to the left;
Home — move the chart to the start point (first bar);
End — move the chart to the end point (last, i.e. most current) bar;
"–" — zoom out (there are 6 levels of zoom available);
"+" — zoom in;
Delete — delete all selected objects;
Backspace — delete most recently added objects, on a last-added-first-removed basis;
Enter — open/close the fast navigation window;
Esc — close any dialog window;
F1 — open the on line help "Userguide";
F2 — open the "History Center" window;
F3 — open the "Global Variables" window;
F4 — open MetaEditor;
F5 — switch to the next profile;
F6 — call the "Tester" dialog window for testing the expert attached to the chart window;
F7 — call the properties dialog window of the expert attached to their chart window, in order to change its settings;
F8 — call the chart setup dialog window, allowing basic chart parameters, colors, etc to be changed;
F9 — call the "New Order" window, allowing the entry of market, limit, stop orders;
F10 — open the "Popup prices" window;
F11 — enable/disable full screen mode;
F12 — scroll the chart one bar to the left;
Shift+F12 — scroll the chart one bar to the right;
Shift+F5 — switch to the previous profile;
Alt+1 — display the chart as OHLC bars;
Alt+2 — display the chart as OHLC candlesticks;
Alt+3 — display the chart as a line (closing prices only);
Alt+A — copy all test/optimization results onto the clipboard;
Alt+W — call the chart management window;
Alt+F4 — exit the program;
Ctrl+A — arrange all indicator window heights by default;
Ctrl+B — call the "Objects List" dialog window;
Ctrl+C or Ctrl+Insert — copy to the clipboard;
Ctrl+D — open/close the "Data Window";
Ctrl+E — enable/disable the attached expert advisor;
Ctrl+F — switch to "Crosshair" mode;
Ctrl+G — show/hide the vertical/horizontal grid;
Ctrl+H — show/hide the OHLC line;
Ctrl+I — call the "Indicators List" dialog window;
Ctrl+L — show/hide volume data on the main chart;
Ctrl+M — open/close the "Market Watch" window;
Ctrl+N — open/close the "Navigator" window;
Ctrl+O — open the "Setup" window;
Ctrl+P — print the chart;
Ctrl+R — open/close the "Tester" window;
Ctrl+S — save the chart prices (OHLCV) in a file having extensions: "CSV", "PRN" or "HTM";
Ctrl+T — open/close the "Terminal" window;
Ctrl+W or Ctrl+F4 — close the chart window that's currently in focus;
Ctrl+Y— show/hide date (period) separators;
Ctrl+Z or Alt+Backspace — undo object deletions in the reverse order they occurred;
Ctrl+F6 — switch to the next chart window;
Ctrl+F9 — open the "Terminal — Trade" window and switch the focus into it, allowing trading operations to be entered via the keyboard.
Attaching indicators to indicators outside of the main price chart
You can attach moving averages and other indicators to indicators on other than the main chart. For example, if you want to use a moving average to smooth RSI, do the following:
1) Create a lower window with RSI in the normal manner.
2) Open the navigator window (press Ctrl-N).
3) Click on the "Indicators" heading in the Navigator window, if necessary, to expand it.
4) Move the mouse to the "Moving Average" item, then (holding down the left button), drag it (a rectangle appears under the arrow cursor) into the RSI window.
5) In the ensuing dialog box, got to the "Apply to" drop down, and set this to "First indicator's data". This will cause the MA to be attached to the first indicator in this window, i.e. the RSI.
6) Adjust other parameters as desired, and press Enter.
NOTE:
-- To create an indicator in a separate window, right-click on its name in the Navigator, and select "Attach to a chart".
-- To create an indicator in the same window as another, drag it's name into the relevant window.
Adding custom-defined indicators to MT4
One of the most powerful MT4 features is that it has a comprehensive but friendly programming language that allows custom-defined indicators, scripts and expert advisors to be written. Here's how to import an already written indicator into MT4's charting facility:
1) Go to a web resource that has the source code for the indicator. A good one is http://www.xeatrade.com/trading/11.html
Note the "# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" index.
So if you want to add (for example) the PPCI indicator to your charts, click on "P" to see all the custom-developed indicators starting with a "P".
Left-click on the PPCI hyperlink. The source code for PPCI appears in the middle of the screen. Left-click inside this window, then press Ctrl-A to select all of the text, then Ctrl-C to copy it.
2) Return to MT4, and press F4 to load the MetaEditor, a tool which allows to create and compile your own indicators, scripts and experts.
3) In MetaEditor, press Ctrl-N to create a new indicator using the Expert Advisor Wizard.
Select the "Custom Indicator" radio button, and click Next.
Type in the name (e.g. PCCI) that you want to use to reference your indicator in MT4, ignore the other fields, and click Next.
On the final dialog window, ignore all fields, and click Finish.
4) Now left-click in the body of the screen, press Ctrl-A to select all the text, and then press Ctrl-V to paste the text you copied back in step 1, completely overwriting the previous text.
5) Then press F5 to save and compile your indicator.
Hopefully, the message "0 error(s), 0 warning(s)" will appear, indicating a "clean compile", i.e. that the programmer wrote the source code correctly, without syntax errors. Press Esc to close the dialog box.
Presto! If you now return to MT4, the new custom indicator should automatically appear both in the Navigator, and also under the menu option "Insert > Indicators > Custom" if you prefer to add it to your chart in this manner.
You can also add scripts and experts in the same way.
In step (1), select the "MQ4 Scripts" or "MQ4 Experts" hyperlink in the left menu.
In step (3), select the appropriate radio button.
Note that these objects are stored in the following folders:
Experts: c:/program files/<mt4 broker name>/experts
Scripts: c:/program files/<mt4 broker name>/experts/scripts
Custom indicators: c:/program files/<mt4 broker name>/experts/indicators
Include (program code, e.g. .MQH) files: c:/program files/<mt4 broker name>/experts/include
Templates: c:/program files/<mt4 broker name>/templates
Data files: c:/program files/<mt4 broker name>/experts/files
NOTE: As an alternative to the above, if you simply copy the .MQ4 file into the relevant folder, and then (exit and) re-start MT4, the expert, script or indicator will automatically be recompiled, and appear in the Navigator.
Some other good sources for MT4 indicators (apart from FF's search facility):
http://www.forexfactory.com/showthread.php?t=62722 (see ZIP file attached to post #1)
http://www.forex-tsd.com (perform a forum search)
http://codebase.mql4.com/ (peform a site search)
http://www.forexmt4.com/_MT4_Indicators/
http://www.desynced.net/fx/eas/indicators.php
http://www.greattradingsystems.com/f...-4-indicators/
http://allforexindicators.com/Default.aspx
http://www.metatraderlibrary.com/forex-indicators/
If you want to delete an expert, script or indicator (CAREFUL!), use Windows Explorer to go to the appropriate folder, and delete the relevant file with the EX4 extension. For example, if you decide that you no longer want to use PCCI, delete file PCCI.EX4
That will effectively remove PCCI from the custom indicators list in MT4
The file PCCI.MQ4 contains the source code for PCCI (which you copied from the web resource), the PCCI.EX4 file is the executable code that was created when you did your compile back in step (5). If you want to re-instate the indicator, all you need to do is reload the source into MetaEditor (press Ctrl-O and open the relevant file), and then press F5 to compile it, which re-creates the executable file used by MT4.
A more simple way of deleting an expert, script or indicator is by using the Navigator (press Ctrl-N). Click on the item you wish to delete, press the DELETE key, and click Yes to confirm the deletion. Note that this deletes both the source (.MQ4) and executable (.EX4) files.
Happy charting!
David
Footnote: the above is repeated in the attached Word doc. If you prefer, you can download the doc, add your own notes to it, and/or print it out for handy reference.
NOTE: More tips here.
March 27, 2012: Added attached document "How to create a ruler to measure multiple R-multiple profit targets".This is handy if you want a measuring tool where you want to vary a SL setting, and have multiple TP settings (that are R-multiples of the SL) adjust themselves automatically. It uses MT4's in-built Fibonacci Channels facility, so there's no third-party indy required.
Miscellaneous links
Solving Vista/Win7 problems: http://4xtrader.net/how-to-run-metat...ws-7-or-vista/
7bit's Debug View thread: http://www.forexfactory.com/showthread.php?t=245303
Steve Hopwood's EA shell: http://www.forexfactory.com/showthread.php?t=282290
MQL4 tutorials: http://www.forexfactory.com/showthread.php?t=6011
see also: http://www.forexfactory.com/showthre...54#post4485554
MQL4 tutorials (full list of links):
http://www.forexfactory.com/showthread.php?t=6011 (zip files with full tutorials)
http://www.metatrader.info/node/34
http://articles.mql4.com/404
http://articles.mql4.com/417
http://articles.mql4.com/466
http://articles.mql4.com/516
http://articles.mql4.com/536
http://book.mql4.com/
http://docs.mql4.com/ (MQL4 reference manual)
http://www.forexfactory.com/showpost.php?p=2160415
Check out Jim Dandy's excellent MQL4 tutorial videos here: http://www.jimdandyforex.com/lessonvideo-links/
Br0ker comparison links: http://www.forexfactory.com/showthread.php?t=282549
TA resources: http://www.forexfactory.com/showthread.php?t=106577
Useful MQL4 functions (my functions library): http://www.forexfactory.com/showthread.php?t=165557
Format of HST files here: http://www.forexfactory.com/showthre...08#post1477708
Export price history to Excel here: http://www.forexfactory.com/showthre...89#post1479389 (see later posts in thread also)
and updated here: http://www.forexfactory.com/showpost...37#post1935637
Export History indicator: http://www.forexfactory.com/showthre...44#post2831344
Export bid/ask to Excel (SMJones, DDE-sample.xls): http://www.forexfactory.com/showthre...23#post1815623
MT4 Expert Advisor Builder: http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Another strategy builder: http://forexsb.com/wiki/start
MQL4: Manual: http://book.mql4.com/
Documentation: http://docs.mql4.com/
Interpreting System Tester Report numbers: http://www.metaquotes.net/experts/ar...tester_report/
Link to MQL4 resources: http://www.forexfactory.com/showpost...15#post2160415
Trade/exit management EAs: http://www.forexfactory.com/showthread.php?t=89371 and http://www.forexfactory.com/showthread.php?t=9553
Compendium of EAs (mainly trade management) in forexsaint’s thread: http://www.forexfactory.com/showthread.php?t=193727
Why MT4 is so widely used: http://www.forexfactory.com/showthre...88#post2785588
What the numbers in MT4's Expert Testing report mean: http://articles.mql4.com/83 and http://articles.mql4.com/127
Using MT4 to plot non-forex charts: http://www.forexfactory.com/showthread.php?t=208577
and http://www.forexfactory.com/showthread.php?t=20535
Reading/writing files outside …\experts\files folder: http://articles.mql4.com/720 and http://codebase.mql4.com/4086
Executing external program: http://forum.mql4.com/16121#109022 and http://support.microsoft.com/kb/238245
How to set up e-mail alerts in MT4: http://broguetraders.com/2011/02/11/...in-metatrader/
also http://www.forexfactory.com/showthread.php?t=23638
and http://www.forexfactory.com/showthread.php?t=273034
MetaTrader 4 Strategy Tester Tutorial: http://www.easyexpertforex.com/backt...imization.html
How to attain 90% modelling quality: http://alansforexblog.com/2008/02/27...pert-advisors/
Free data source for EAs: http://www.forextester.com/datasources.html
EA review/constriction info: http://eareview.net/tick-data
Trade juice table on statistical validity: http://www.tradejuice.com/system-tra...ing-system.htm
Ideas on backtesting: http://www.forexfactory.com/showthre...37#post6160037
Possible sources of tick data:
http://ratedata.gaincapital.com/
http://www.forextickdata.com/services.htm
http://www.tickplusdata.com/forexlist.htm
http://disktrading.is99.com/disktrading/#FOREX
OMZ to ASCII converter here: http://www.quote-solutions.com/softw...historycentre/
http://www.tssupport.com/services/hc/
http://www.goforex.net/forex-directory/forex-data.htm
http://www.global-view.com/forex-tra...forex-history/
http://www.thinkingstuff.com/Resourc...5/Default.aspx
MT4 script to convert tick data to FXT/HST format: http://codebase.mql4.com/516
Free programming threads:
http://www.forexfactory.com/showthread.php?t=168808
http://www.forexfactory.com/showthread.php?t=166758
http://www.forexfactory.com/showthread.php?t=212422
http://www.forexfactory.com/showthread.php?t=197798
How to read/interpret the stats on a Trade Explorer: http://www.forexfactory.com/showthread.php?t=410405
Pips, lots, spread, swap, risk, position sizing, margin, leverage calculations explained: http://www.forexfactory.com/showthre...85#post2285285
(NEW MATERIAL IN RED TYPEFACE)
Hi all
The following post used to be a sticky in the MetaTrader forum, but it appears to have been lost. Hence I'm re-posting it here.
Use of the mouse and mousewheel, and their keyboard equivalents
Scrolling the chart
Hold down the left mouse button and drag the mouse in the main chart area, to scroll left/right.
Or you can also simply roll the mousewheel down/up, or use the left/right arrow keys, to likewise scroll the chart view left/right.
To scroll a whole screen at a time, use Page Up (scroll left) and Page Down (scroll right).
To reposition to the leftmost bar on the chart, press Home.To reposition to the most recent (rightmost) bar, press End.
To step forward one bar at a time, press F12.
To step backward one bar at a time, press Shift-F12.
Scrolling a chart beyond the leftmost bar will add historical bars to the beginning of the chart, until no more are available from MT4's historical database.
Moving directly to a certain date/time
To re-position immediately to a certain date, press Enter, then type in the date in the form DD.MM.YY and press Enter again. Leading zeros can be omitted (e.g. to move to 4 July 2005, type 4.7.5). To re-position to a certain date/time, use the format HH:MM or DD.MM.YY HH:MM (e.g. to position to 8:07am TODAY on a 1-min chart, simply type 8:7).
You can also use the "Fast Navigation Box" to change either the currency symbol, or the period, thus:
Inserted Code
1. time (hours:minutes) example: 08:30; 8:30; 2. date example: 2004.10.16; 16.10.2004; 16.10.04; 3. date and time example: 2004.10.16 8:30; 16.10.2004 8:30; 16.10.04 8:30; 4. symbol example: GBPUSD; EURUSD; 5. chart period example: M1; M5; M15; M30; H1; H4; D1; W1; MN; 6. symbol, chart period example: GBPUSD, M30; EURUSD, D1;
You can re-scale the chart vertically by moving the mouse into the vertical axis area at the right of the screen, and then dragging downwards (with the left button held down) to compress the chart bars, or dragging upwards to expand them.
Double click to reset the chart to its original scale.
Horizontal zoom and re-scale
Similarly, you can adjust the width of the price bars by moving the mouse into the horizontal axis area at the bottom of the screen, and then dragging right (zoom in) or left (zoom out). Or simply use the "+" and "–" keys to achieve this.
Indicators
Double-click on or near indicators with the left mouse button, to call their parameter setup windows.
Right-click to call the indicator's context menu.
If the screen is cluttered with overlapping indicators and/or objects, making it too difficult to select the desired indicator, press Ctrl-I to call up the Indicators dialog window. Double click (or click the Edit button, or Alt-E) on the indicator to edit its properties (parameters, colors, etc), or click the Delete button (or Alt-D) to remove it from the chart.
You can use the Home, End and Page/arrow Up/Down keys to navigate up/down the list.
Objects
Double-click on or near an object (line studies, texts, arrows, geometric shapes) to select the object. Once selected, you can move an object by left clicking on it (or in the case of or trendline or shape, it's center handle) and dragging it to the desired destination. Shapes, trendlines, channels etc may be extended by dragging the handles on the relevant edges. The number "X/Y" appears, where "X" = the width of the shape in candles, and "Y" = the height of the shape in pips.
Right-click on a selected object to open its context menu.
If the screen is cluttered with overlapping indicators and/or objects, making it too difficult to select the desired object(s), press Ctrl-B to call up the Objects dialog window. Left click the check boxes on/off to select/deselect relevant object(s). Double click (or click the Edit button, or Alt-E) on an object to edit its properties (parameters, colors, etc), or click the Delete button (or Alt-D) to remove it from the chart. To quickly delete a whole block of objects, repeatedly press Alt-D or hold it down (careful, they disappear rather quickly!)
You can use the Home, End and Page/arrow Up/Down keys to navigate up/down the list.
Click on the 'Name' or 'Description' heading area to sort by name, or description, respectively.
Left-click to select an item. You can use Ctrl-click to add individual items to a selection, Shift-click to add a group of consecutive items, or press Ctrl-A to select all items. Then click the Edit button (or press Alt-E) to edit all items in the group consecutively, or the Delete button (or press Alt-D) to delete all selected items simultaneously (careful!).
Alternatively, from the chart window, press Backspace repeatedly to delete the most recently added object(s) on a last-added-first-removed basis (useful if you want to quickly check out a Fibo or regression channel, then remove it). Then press Ctrl-Z to undo any accidental deletes, in reverse order.
Or press the Delete key to remove ALL SELECTED objects.
Parallel Trendlines
Ctrl + left click on a selected trend line to draw a parallel trend line (create a channel). Can also be used with vertical and horizontal lines.
Duplicating objects
The 'Parallel Trendlines' concept extends to ALL objects (vertical, horizontal and trend lines; shapes - triangle, square, ellipse; text and labels; arrows and symbols; and studies like channels, Fibo, Gann, Pitchfork, etc). Here's how to duplicate any object:
-- Select the object by clicking on it**
-- While holding down the Ctrl key: move the mouse over any one of the object's handles, and, holding down the left button drag the mouse to where you want the duplicated object to be located
This shortcut also duplicates all of the proprties of the parent object, e.g. if you have red, green and blue objects, and you want to create a green one, simply duplicate it. This is quicker than creating a new object, and then changing its color to green.
** Object selection options
Press Ctrl-O and then select the 'Objects' tab.
-- "Select object by single mouse click" - if checked OFF, you must double click to select an object, and right click to modify its properties. If checked ON, single click to select an object, and double click to modify its properties.
-- "Select object after creation" - if checked ON, any object is automatically selected immediately after you create it.
-- "Show properties after creation" - if checked ON, the property modification window for the object is displayed, immediately after you create the object.
OR
Press Ctrl-B to display the objects list. Click on the checkbox (at left) for each object you want selected.
Information Bubble
Hover the mouse cursor on or over an element, object or indicator to see the prompt (help information bubble).
Crosshair mode, and ruler tool
Click the mousewheel to switch cursor to the "crosshair" mode.
This can also be achieved by pressing Ctrl-F, or selecting the crosshair icon from the toolbar. The crosshairs also display vertical (price) and horizontal (date/time) co-ordinates at the right and bottom of the chart.
Simply left-click to exit crosshair mode.
Now, here is something extremely useful that I haven’t found in the on-line help:
While in crosshair mode, hold down the left mouse button and drag the mouse to obtain a ruler-type tool that measures vertical (number of pips) and horizontal (number of bars) from the center of the crosshairs. The tool displays counters in the form "A/B/C" where A is the number of bars right or left of the crosshair, B is the number of pips from crosshair to cursor, and C is the price at the cursor.
I find "B" extremely useful for measuring the number of pips between any two points, thus:
1) move the mouse to the point you want to measure from (the "anchor" point);
2) click the mousewheel to enter crosshair mode;
3) then hold down the left button and move the mouse to any number of destination points, to see the number of pips between the anchor point and the current mouse destination.
This saves having to calculate this distance manually, as the difference between two prices. Pretty cool!
You can also use this facility to count price bars (reading "A") between any two dates/times.
Reference and anchor points
'Fixed chart position' arrow: At the lower left of the chart there is a dark colored** arrow. Dragging it with the mouse sets the reference (anchor) point for the chart. Now when you zoom in or out, or even change the timeframe, this point remains anchored at its existing location.
'Chart shift' arrow: At the upper right of the chart there is likewise a dark colored** arrow. Drag it left or right with the mouse to set the location for the last (most current) bar on the chart (i.e. set the amount of empty "whitespace" at the right of the chart).
[** the color is actually set to the same color as the Grid color (press F8 to change the Grid color in the chart Properties window). Hence if the arrows are difficult to see, change the Grid color to a color that contrasts better with the chart background.]
Removing all indicators and objects from your chart
Load a blank chart (the pair/timeframe doesn't matter), then change the settings (press F8) to set colors, grid, etc to suit your preference. Then save this as a template named (for example) Z. (menu option: Charts > Template > Save Template……)
Then, whenever you want to instantly remove all indicators and objects from your chart, simply load template Z, by quickly using the hotkey combination: Alt-C T Z
The 'Grid' and 'Volumes' color selections (obtained by pressing F8 to summon the chart Properties window) each serve dual purposes. The Grid color doubles both as the color for the chart grid (press Ctrl-G to toggle the grid on/off), but also the color for the horizontal Bid price line. Hence if you don't want the Bid price line cluttering your chart (e.g. it's easily confused as another S/R line), and you never use the grid facility, then set the Grid color to 'None', and the Bid price line disappears. I use the Bid/Ask line indicator that I've attached to this post, instead. You can of course turn the Ask line off either by setting the 'Ask line' color to 'None', or by unchecking 'Show Ask line' on the Common tab.
The 'Volume' color selection doubles both as the color for volume bars (press Ctrl-L to toggle these on/off) and also as the color for the order entry level lines. Hence if you don't want these lines cluttering your chart, and you don't use the Volume facility, then set the 'Volume' color to 'None', and the order entry level lines will disappear. Of course you can suppress the displaying of SL and TP level lines by changing the 'Stop Levels' color to 'None'.
List of hotkeys
There are many other useful hotkeys. Here is a comprehensive list:
Left arrow — scroll chart to the left;
Right arrow — scroll chart to the right;
Up arrow — quickly scroll chart to the left or (if the scale is defined), scroll chart upwards;
Down arrow — quickly scroll chart to the right or (if the scale is defined), scroll chart downwards;
Numpad 5 — restores chart vertical scale to its original default. If the scale was defined, this returns the chart back to its visible range;
Page Up — scroll a whole screen to the left;
Page Down — scroll a whole screen to the left;
Home — move the chart to the start point (first bar);
End — move the chart to the end point (last, i.e. most current) bar;
"–" — zoom out (there are 6 levels of zoom available);
"+" — zoom in;
Delete — delete all selected objects;
Backspace — delete most recently added objects, on a last-added-first-removed basis;
Enter — open/close the fast navigation window;
Esc — close any dialog window;
F1 — open the on line help "Userguide";
F2 — open the "History Center" window;
F3 — open the "Global Variables" window;
F4 — open MetaEditor;
F5 — switch to the next profile;
F6 — call the "Tester" dialog window for testing the expert attached to the chart window;
F7 — call the properties dialog window of the expert attached to their chart window, in order to change its settings;
F8 — call the chart setup dialog window, allowing basic chart parameters, colors, etc to be changed;
F9 — call the "New Order" window, allowing the entry of market, limit, stop orders;
F10 — open the "Popup prices" window;
F11 — enable/disable full screen mode;
F12 — scroll the chart one bar to the left;
Shift+F12 — scroll the chart one bar to the right;
Shift+F5 — switch to the previous profile;
Alt+1 — display the chart as OHLC bars;
Alt+2 — display the chart as OHLC candlesticks;
Alt+3 — display the chart as a line (closing prices only);
Alt+A — copy all test/optimization results onto the clipboard;
Alt+W — call the chart management window;
Alt+F4 — exit the program;
Ctrl+A — arrange all indicator window heights by default;
Ctrl+B — call the "Objects List" dialog window;
Ctrl+C or Ctrl+Insert — copy to the clipboard;
Ctrl+D — open/close the "Data Window";
Ctrl+E — enable/disable the attached expert advisor;
Ctrl+F — switch to "Crosshair" mode;
Ctrl+G — show/hide the vertical/horizontal grid;
Ctrl+H — show/hide the OHLC line;
Ctrl+I — call the "Indicators List" dialog window;
Ctrl+L — show/hide volume data on the main chart;
Ctrl+M — open/close the "Market Watch" window;
Ctrl+N — open/close the "Navigator" window;
Ctrl+O — open the "Setup" window;
Ctrl+P — print the chart;
Ctrl+R — open/close the "Tester" window;
Ctrl+S — save the chart prices (OHLCV) in a file having extensions: "CSV", "PRN" or "HTM";
Ctrl+T — open/close the "Terminal" window;
Ctrl+W or Ctrl+F4 — close the chart window that's currently in focus;
Ctrl+Y— show/hide date (period) separators;
Ctrl+Z or Alt+Backspace — undo object deletions in the reverse order they occurred;
Ctrl+F6 — switch to the next chart window;
Ctrl+F9 — open the "Terminal — Trade" window and switch the focus into it, allowing trading operations to be entered via the keyboard.
Attaching indicators to indicators outside of the main price chart
You can attach moving averages and other indicators to indicators on other than the main chart. For example, if you want to use a moving average to smooth RSI, do the following:
1) Create a lower window with RSI in the normal manner.
2) Open the navigator window (press Ctrl-N).
3) Click on the "Indicators" heading in the Navigator window, if necessary, to expand it.
4) Move the mouse to the "Moving Average" item, then (holding down the left button), drag it (a rectangle appears under the arrow cursor) into the RSI window.
5) In the ensuing dialog box, got to the "Apply to" drop down, and set this to "First indicator's data". This will cause the MA to be attached to the first indicator in this window, i.e. the RSI.
6) Adjust other parameters as desired, and press Enter.
NOTE:
-- To create an indicator in a separate window, right-click on its name in the Navigator, and select "Attach to a chart".
-- To create an indicator in the same window as another, drag it's name into the relevant window.
Adding custom-defined indicators to MT4
One of the most powerful MT4 features is that it has a comprehensive but friendly programming language that allows custom-defined indicators, scripts and expert advisors to be written. Here's how to import an already written indicator into MT4's charting facility:
1) Go to a web resource that has the source code for the indicator. A good one is http://www.xeatrade.com/trading/11.html
Note the "# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" index.
So if you want to add (for example) the PPCI indicator to your charts, click on "P" to see all the custom-developed indicators starting with a "P".
Left-click on the PPCI hyperlink. The source code for PPCI appears in the middle of the screen. Left-click inside this window, then press Ctrl-A to select all of the text, then Ctrl-C to copy it.
2) Return to MT4, and press F4 to load the MetaEditor, a tool which allows to create and compile your own indicators, scripts and experts.
3) In MetaEditor, press Ctrl-N to create a new indicator using the Expert Advisor Wizard.
Select the "Custom Indicator" radio button, and click Next.
Type in the name (e.g. PCCI) that you want to use to reference your indicator in MT4, ignore the other fields, and click Next.
On the final dialog window, ignore all fields, and click Finish.
4) Now left-click in the body of the screen, press Ctrl-A to select all the text, and then press Ctrl-V to paste the text you copied back in step 1, completely overwriting the previous text.
5) Then press F5 to save and compile your indicator.
Hopefully, the message "0 error(s), 0 warning(s)" will appear, indicating a "clean compile", i.e. that the programmer wrote the source code correctly, without syntax errors. Press Esc to close the dialog box.
Presto! If you now return to MT4, the new custom indicator should automatically appear both in the Navigator, and also under the menu option "Insert > Indicators > Custom" if you prefer to add it to your chart in this manner.
You can also add scripts and experts in the same way.
In step (1), select the "MQ4 Scripts" or "MQ4 Experts" hyperlink in the left menu.
In step (3), select the appropriate radio button.
Note that these objects are stored in the following folders:
Experts: c:/program files/<mt4 broker name>/experts
Scripts: c:/program files/<mt4 broker name>/experts/scripts
Custom indicators: c:/program files/<mt4 broker name>/experts/indicators
Include (program code, e.g. .MQH) files: c:/program files/<mt4 broker name>/experts/include
Templates: c:/program files/<mt4 broker name>/templates
Data files: c:/program files/<mt4 broker name>/experts/files
NOTE: As an alternative to the above, if you simply copy the .MQ4 file into the relevant folder, and then (exit and) re-start MT4, the expert, script or indicator will automatically be recompiled, and appear in the Navigator.
Some other good sources for MT4 indicators (apart from FF's search facility):
http://www.forexfactory.com/showthread.php?t=62722 (see ZIP file attached to post #1)
http://www.forex-tsd.com (perform a forum search)
http://codebase.mql4.com/ (peform a site search)
http://www.forexmt4.com/_MT4_Indicators/
http://www.desynced.net/fx/eas/indicators.php
http://www.greattradingsystems.com/f...-4-indicators/
http://allforexindicators.com/Default.aspx
http://www.metatraderlibrary.com/forex-indicators/
If you want to delete an expert, script or indicator (CAREFUL!), use Windows Explorer to go to the appropriate folder, and delete the relevant file with the EX4 extension. For example, if you decide that you no longer want to use PCCI, delete file PCCI.EX4
That will effectively remove PCCI from the custom indicators list in MT4
The file PCCI.MQ4 contains the source code for PCCI (which you copied from the web resource), the PCCI.EX4 file is the executable code that was created when you did your compile back in step (5). If you want to re-instate the indicator, all you need to do is reload the source into MetaEditor (press Ctrl-O and open the relevant file), and then press F5 to compile it, which re-creates the executable file used by MT4.
A more simple way of deleting an expert, script or indicator is by using the Navigator (press Ctrl-N). Click on the item you wish to delete, press the DELETE key, and click Yes to confirm the deletion. Note that this deletes both the source (.MQ4) and executable (.EX4) files.
Happy charting!
David
Footnote: the above is repeated in the attached Word doc. If you prefer, you can download the doc, add your own notes to it, and/or print it out for handy reference.
NOTE: More tips here.
March 27, 2012: Added attached document "How to create a ruler to measure multiple R-multiple profit targets".This is handy if you want a measuring tool where you want to vary a SL setting, and have multiple TP settings (that are R-multiples of the SL) adjust themselves automatically. It uses MT4's in-built Fibonacci Channels facility, so there's no third-party indy required.
Miscellaneous links
Solving Vista/Win7 problems: http://4xtrader.net/how-to-run-metat...ws-7-or-vista/
7bit's Debug View thread: http://www.forexfactory.com/showthread.php?t=245303
Steve Hopwood's EA shell: http://www.forexfactory.com/showthread.php?t=282290
MQL4 tutorials: http://www.forexfactory.com/showthread.php?t=6011
see also: http://www.forexfactory.com/showthre...54#post4485554
MQL4 tutorials (full list of links):
http://www.forexfactory.com/showthread.php?t=6011 (zip files with full tutorials)
http://www.metatrader.info/node/34
http://articles.mql4.com/404
http://articles.mql4.com/417
http://articles.mql4.com/466
http://articles.mql4.com/516
http://articles.mql4.com/536
http://book.mql4.com/
http://docs.mql4.com/ (MQL4 reference manual)
http://www.forexfactory.com/showpost.php?p=2160415
Check out Jim Dandy's excellent MQL4 tutorial videos here: http://www.jimdandyforex.com/lessonvideo-links/
Br0ker comparison links: http://www.forexfactory.com/showthread.php?t=282549
TA resources: http://www.forexfactory.com/showthread.php?t=106577
Useful MQL4 functions (my functions library): http://www.forexfactory.com/showthread.php?t=165557
Format of HST files here: http://www.forexfactory.com/showthre...08#post1477708
Export price history to Excel here: http://www.forexfactory.com/showthre...89#post1479389 (see later posts in thread also)
and updated here: http://www.forexfactory.com/showpost...37#post1935637
Export History indicator: http://www.forexfactory.com/showthre...44#post2831344
Export bid/ask to Excel (SMJones, DDE-sample.xls): http://www.forexfactory.com/showthre...23#post1815623
MT4 Expert Advisor Builder: http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Another strategy builder: http://forexsb.com/wiki/start
MQL4: Manual: http://book.mql4.com/
Documentation: http://docs.mql4.com/
Interpreting System Tester Report numbers: http://www.metaquotes.net/experts/ar...tester_report/
Link to MQL4 resources: http://www.forexfactory.com/showpost...15#post2160415
Trade/exit management EAs: http://www.forexfactory.com/showthread.php?t=89371 and http://www.forexfactory.com/showthread.php?t=9553
Compendium of EAs (mainly trade management) in forexsaint’s thread: http://www.forexfactory.com/showthread.php?t=193727
Why MT4 is so widely used: http://www.forexfactory.com/showthre...88#post2785588
What the numbers in MT4's Expert Testing report mean: http://articles.mql4.com/83 and http://articles.mql4.com/127
Using MT4 to plot non-forex charts: http://www.forexfactory.com/showthread.php?t=208577
and http://www.forexfactory.com/showthread.php?t=20535
Reading/writing files outside …\experts\files folder: http://articles.mql4.com/720 and http://codebase.mql4.com/4086
Executing external program: http://forum.mql4.com/16121#109022 and http://support.microsoft.com/kb/238245
How to set up e-mail alerts in MT4: http://broguetraders.com/2011/02/11/...in-metatrader/
also http://www.forexfactory.com/showthread.php?t=23638
and http://www.forexfactory.com/showthread.php?t=273034
MetaTrader 4 Strategy Tester Tutorial: http://www.easyexpertforex.com/backt...imization.html
How to attain 90% modelling quality: http://alansforexblog.com/2008/02/27...pert-advisors/
Free data source for EAs: http://www.forextester.com/datasources.html
EA review/constriction info: http://eareview.net/tick-data
Trade juice table on statistical validity: http://www.tradejuice.com/system-tra...ing-system.htm
Ideas on backtesting: http://www.forexfactory.com/showthre...37#post6160037
Possible sources of tick data:
http://ratedata.gaincapital.com/
http://www.forextickdata.com/services.htm
http://www.tickplusdata.com/forexlist.htm
http://disktrading.is99.com/disktrading/#FOREX
OMZ to ASCII converter here: http://www.quote-solutions.com/softw...historycentre/
http://www.tssupport.com/services/hc/
http://www.goforex.net/forex-directory/forex-data.htm
http://www.global-view.com/forex-tra...forex-history/
http://www.thinkingstuff.com/Resourc...5/Default.aspx
MT4 script to convert tick data to FXT/HST format: http://codebase.mql4.com/516
Free programming threads:
http://www.forexfactory.com/showthread.php?t=168808
http://www.forexfactory.com/showthread.php?t=166758
http://www.forexfactory.com/showthread.php?t=212422
http://www.forexfactory.com/showthread.php?t=197798
How to read/interpret the stats on a Trade Explorer: http://www.forexfactory.com/showthread.php?t=410405
Pips, lots, spread, swap, risk, position sizing, margin, leverage calculations explained: http://www.forexfactory.com/showthre...85#post2285285
Attached File(s)
![File Type: doc](https://assets.faireconomy.media/images/attach/doc.gif)