MT4 Scripts

MT4 Scripts are provided to fill in essential Metatrader functions that every forex trader needs, and to demonstrate how to write MQL4 code in a simple, concise program. MQL4 source code is provided for all Metatrader scripts in *.MQ4 format.

How to Remove a MT4 Script from a Metatrader Chart If you have a runaway script that you just can't kill, read this Metatrader help article.

Clean Up All Objects MQL4 for Metatrader Are you tired of those lingering objects cluttering your Metatrader 4 screen? CleanupAll_Objects.mq4 is a simple MQL4 script that deletes all objects from a given Metatrader chart within the MT4 platform. As usual MQL4 code is available for this MQL4 script. If you're new to MQL4 coding, this sample shows how to use the ObjectDelete() function to clean things up in Metatrader.

Close All Orders This Symbol Only MQL4 for Metatrader If you really need to exit all positions within the Metatrader client, CloseAll_ThisSymbol.mq4 is a MQL4 script that does the job. This MT4 Script puts together many of the concepts discussed in the MQL4 code tutorial titled, "How to write a close all script in MQL4?" This MQL4 script allows Metatrader traders to put in a slippage amount and a magic number. The default MagicNumber variable is set to -1 which means all magic numbers for the selected forex symbol. This MQL4 code also demonstrates how to use both while and for loops.This is a must have for all Metatrader traders.

Close All Trades All Symbols MQL4 for Metatrader Sometimes forex profits or losses come in a big way. At those times it's handy to have a speedy Metatrader tool to close all orders on all forex symbols. CloseAll_AllSymbols.mq4 is such a tool for Metatrader that should be in every trader's Navigator pane. A discussion of the MQL4 script is found in the MQL code tutorial, "How to write a close all script in MQL4?" This MQL4 script allows Metatrader traders to put in a slippage amount and a magic number. The default MagicNumber variable is set to -1 which means all magic numbers for the selected symbol. This MQL4 code also demonstrates how to use both while and for loops in Metatrader. Check it out! Every forex trader needs a good close all script. Also try:

Buy With Stop Loss and Take Profit MQL4 for Metatrader Sell With Stop Loss and Take Profit MQL4 for Metatrader Double click the Metatrader script and you will either buy or sell and a stop loss and take profit will be set. The entry is at market, and the stop loss and target are based on the actual entry price. This handy buy / sell entry MT4 script belongs in every Forex trader's Metatrader Navigator window. In this sample it's easy to customize the stop loss and take profit amounts, work with magic number, and set a custom slippage amount. You can even determine whether you wish to have a confirmation box pop up after you double-click the Metatrader script, or if you want the order to execute immediately.

Follow patrickmwhite on Twitter

For updates