MetaTrader Trading Tools
Showing 235 results in this view

Metatrader shortcuts extensions (Emilio Shortcuts) :)

Author:

Emilio Reale is a trader that uses MT4 and other platforms. It uses IdleLib.dll downloadable in the libraries section of codebase (included for semplicity).

A brief intro:

With this script it is very easy to change objects with some useful keyboard shortcuts. Normally I draw lot of objects in the charts and have some trouble recognizing them so:

  • this script change the size of the trend lines
  • this script change the size of the horizontal lines
  • this script change the size of the vertical lines
  • this script is able to exclude some objects from processing
  • this script print the market info
  • this scrips draw automatically expansion objects from a particular line (line name _exp)
  • if the line _exp is not drawn correctly this script exchange the direction of the line
  • this script delete of a line of a particular type very quickly
  • this script measure distances (swing) drawing a simple line (line name _lp)
  • this scrptt contains it's own help
  • to EXIT the script press the letter "X"
  • this script changes colors of lines
  • this script cycle colors of lines
  • this script shortcuts the screenshot saving
I use a script shortcut (alt s) to activate the script automattically in MT4 and I use the fuction select objects with single mouse click to accellerate the selection of the objects.

keys (1 - 5) changes the size of the trendlines

key (d) delete all line types

key (t) changes type of objects to work on (trendlines, vertical lines, horizontal lines)

key (e) draw from the line named _exp a fibo expansion object

key (w) convert the expansion object back to a line

key (o) delete all objects

key (s) work on object selected and deselected ( I use the prefix _ tho identify objects)

key (?) prints help

key (p) prints the distance of a particular line wich name is _lp (used to calculate targets and stop loss)

key (s) save a screenshot

Image:

help screen

change color and size

prints out the distance of the line _lp

_exp to to draw expansion object

expansion object drawn

... and more feel free to investigate by yourself :)

Recommendations:

Place the dll file in the experts\libraries directory

Place the mq4 file in the experts\script directory

Unfortunatly MT4 does not have a function to identify by code so I must use two kind of lines name the names beginning with an "_ " underscore and the normal name this workaround permits the code to work on some objects or not (key S) selected objects are without the _ prefix

REMEMBER TO EXIT THE SCRIPT WITH THE X KEY WHEN THE WORK IS DONE!

you can follow me on twitter @emiliostefano or find me on facebook as Emilio Reale.

Feel yourself free to vote, comment, improve and ask infos.

Regards!

Market Report

Given a list of symbols, this script creates a HTML file in experts/files which looks like this

Market Overview

You can set up the Timeframe and the Moving Average Periods

The script reads a file called "symbols.txt" from experts/files. It has the following format

*EUR *USD *CHF *JPY *CAD *AUD *NZD *GBP *MXN *HKD *NOK *SEK *ZAR GOLD SILVER

All entries with "*" are currencies, the script will create all combinations for example EURUSD and USDEUR. If it gets a price for one of the constructed pairs it considers this as existent.

Feel free to include your own indicator into the report.

XIT_BuySellAutoStoploss.mq4 - Stoploss set from Fractal Levels, Money management Risk/Reward

XIT_BuySellAutoStoploss.mq4 - Stoploss set from Fractal Levels, Money management Risk/Reward

My main goal here with this script was to help improve my win ratio, by setting my stoploss at fractals with the best support. I had been using fixed stoploss values, and kept having the stop hit and within minutes the price went back into the correct direction. This script has really helped me spot out recent support/resistance levels, providing good stop levels.

Here are some of the features of the script, and a basic run threw of how to use it.

First off you must either choose to BUY or SELL. If both are left false you will get a message stating this and have to relaunch the script. Same error will occur if both are true.

The next thing to do would be to set your Risk%, default is set at 2%.

The way that i calculate lots to risk in this script is as follows:

FreeMargin * Risk% = RiskCapital

(RiskCapital / StopLossPips) / (Leverage / ExchangeRate) = Volume

This formula should give an accurate Risk/Stoploss pip volume. On accounts with small deposits you may end up risking more than the risk percentage you were hoping for. In this case you will get a message stating that you are risking more than your Risk%. You will have the option to continue or not.

The Reward multiplier is fairly simple, basically if you want your takeprofit set to the same number of pips as the stoploss enter 1, for twice the stoploss pips 2 etc...

StopAdd, just adds x amount of pips to the fractal based stoploss level.

MaxSlip, sets the maximum price slippage allowed when opening trade.

MaxSpread, sets the maximum allowed spread.

Magic, sets the magic number for the trade. 0 if none.

The next thing to do is choose the Fractal level you wish to place your stop at. It is a good idea to have the fractal indicator on your chart so you can see a clearer picture of these levels. There will be a message asking if you want to place your stop at 0.3434 etc... if the first stop is where you want it, click no and go to the next Fractal and so on.

After clicking yes the script to run as intended and open your order. If there is an error, you should get a message stating what it is.

I hope this script can help some of you out, and please let me know if there issues with the script so that i can get them all fixed. Also if there are any additions or modifications that would make this script better please let me know..

Happy Trading

Twitpic - Send chart screenshot

Author:

gunzip <spammmmme@gmail.com>

As usual, you have to put it into experts/scripts metatrader subfolder and restart mt4 eventually (or just compile it if you are able to). You don't need to download anything but the script itself. You may edit (right click + modify) the script to put your twitter username and password inside it so you don't have to re-type them every time (if you feel it's safe to put them in clear text directly there) An alert should appear once the chart gets posted. Inputs are:

  • username
  • password
  • message (eventually leave blank to skip posting to twitter and just upload the chart screenshot)
  • width of the screenshot
  • height of the screenshot

(note that you don't have to download the library as is embedded in the twitpic script)

Programmatic modification of Tester "From:" and "To:" fields with user32.dll

For this script to run properly you must have the strategy tester window open.

I made this for the purpose of creating a distributed automated optimization package. I was unsatisfied with the available automated optimization code because it necessitates modification of expert advisor code.

This was created and tested on Windows 7 64 bit. It is possible that the #define statements need to be changed to point to the proper IDs for your operating system.

I was unable to directly send a string to the date field because its control, SysDateTimePick32, is difficult to interface with MQL4.

Instead I used a somewhat round-about method of parsing the control's text and sending UP, DOWN, LEFT, and RIGHT keystrokes to adjust the date.

I posted this script because I found it very time consuming to find the necessary information to achieve this (especially for a Windows API newbie like myself). Hopefully this will help others.

All Market Symbols and Data extraction script

Description:

Reads all available instruments and their characteristics and generates an HTML report. Positive Swaps are highlighted.

Drag and drop the script on whatever chart.

To visualize the report, just open it with your browser. (Its file is contained in the "/experts/files/" folder).

An example of the Report can be found here .

Time Script

Description:

The script prints the week day and time.

GMail Reader using MQL and wininet

Description:

This script reads your unread GMail messages.

Script properties consist of:

  • GMailUserName = "your_account@gmail.com";
  • GMailPassword = "your_password";
  • NumOfEntries = 5.

The feed consist of maximum of 20 entries of unread messages.

It is far easier writing code than writing description.. lol

Feedback is appreciated :)

Statement To Chart

Just a simple script, that reads the HTML file a report, or detailed report, and draws a transaction from it on the chart, in standard form. Orders arrows will be drawn for the current tool. If the report contains trade on multiple instruments, you have to switch the chart itself. Trading instruments, which was trading will be printed out as a tip. External variables - name of the file, and mode erase its own graphics. The report file is first necessary to put in the \ terminal \ experts \ files \

LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price

Description:

The script runs in background and writes the distance of pips from horizontal lines on the chart to the current market price.

You can drag lines to see the distance.

Image:

Trading scripts with pictures

Description:

I like to keep a record of my trades so that I can look back and see where I might make improvements in my trading decisions. To make that easier I created a script that would take a snapshot of the chart, give it a unique name and file it for me. Later it occurred to me that I could just add this feature to the trading execution scripts I was already using and thus save myself a step. I use them with a HotKey setup.

I thought someone might find the scripts or the actions they perform useful so I am making them available to all.

There are 5 scripts that execute trades, "Buy Market", "Sell Market", "Buy Market with user check", "Sell Market with user check" and "Close Orders".

Also the is original that just executes the picture of a chart called "Snapshot".

Ironically there are no pictures of how they work, but there are comment instructions in the top of each script that should suffice and the titles are fairly self-explanatory:

  • Buy Market - when dragged onto the chart it executes a buy at market and takes a picture of the chart at the time the trade is executed, names it and files it in C:\Program Files\MetaTrader4\experts\files. Trade values are modified in MetaEditor.
  • Sell Market - when dragged onto the chart it executes a sell at market and takes a picture of the chart at the time the trade is executed, names it and files it in C:\Program Files\MetaTrader4\experts\files. Trade values are modified in MetaEditor.
  • Buy Market with user check - pauses when dragged onto the chart to allow you to set the parameters before it executes a buy at market and takes a picture of the chart at the time the trade is executed, names it and files it in C:\Program Files\MetaTrader4\experts\files.
  • Sell Market with user check - pauses when dragged onto the chart to allow you to set the parameters before it executes a sell at market and takes a picture of the chart at the time the trade is executed, names it and files it in C:\Program Files\MetaTrader4\experts\files
  • Close Orders - when dragged onto the chart it closes all orders on the chart and takes a picture of the chart at the time the trade is executed, names it and files it in C:\Program Files\MetaTrader4\experts\files.
  • Snapshot - when dragged onto the chart it takes a picture of the chart at that time, names it and files it in C:\Program Files\MetaTrader4\experts\files.

Remembering the old adage "you get what you pay for", I suggest you check these out for yourself thoroughly (as you should with all code from this site) to see if they will work for you.

Export Trades

This script creates a history.csv in the experts/file directory. it exports your history into a .csv file which can be read by excel or similar. You can sort your trades and see easily how much a certain EA won or lost.

You can read it with Excel or similar, sort by Magic Number or sort by Comment then sum up the Profit from a certain expert. It only exports buy and sell, not canceled orders or anything else.

If the spread sheet in your language needs "," instead of "." for numbers, you can switch the WantKomma variable at the top of the script.