Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Facebook !
Rejoignez notre page de fans
Accédez à la CodeBase depuis votre terminal MetaTrader 5
Vous n'avez pas trouvé le bon code ? Commandez-le dans la section Freelance
Comment rédiger un Expert Advisor ou un indicateur

Codes sources MQL4 des scripts pour MetaTrader 4

icon

Les scripts sont de petites applications qui effectuent des actions ponctuelles. Vous pouvez, par exemple, supprimer tous les objets d'un graphique ou placer un ensemble de commandes pour une position ouverte. Vous trouverez ici des centaines d'applications permettant d'automatiser de petites fonctions analytiques ou de trading.

Les scripts peuvent être téléchargés gratuitement et exécutés dans MetaTrader 4.

Soumettre votre code
dernier | meilleur

Reverses all open trades after Closure for all symbols .

Bars Pips for Chart Symbol and Period selected

Hedge Symbol 100%

Open Charts

Orders Closure

Hedge with a stop order, instead of placing a Stop Loss.

Short description.

Short description.

Hedge Dollar index USIDX against its constitutive FOREX pairs EURUSD GBPUSD USDJPY USDCAD USDSEK USDCHF

Break on Code Error ! This script is a general example of using error brake in any strategy.

The Breakeven Point, or Titik Impas, denotes the price level at which a trade's profit becomes zero. By setting a position to Titik Impas Breakeven, the stop-loss is aligned with the position's opening price. This strategy proves valuable when you aim to allow profits to accumulate while ensuring that the trade remains secure and does not revert to negative territory.

All open trades must be of same symbol and type, e.g. all GBPUSD and all BUY. This script will close out your position using one large trade to hedge your position then using CloseBy() function to close all trades against the one large trade until all trades are closed. There can be a maximum of 500 open trades.

Multi_BreakEven is a script file that allows multiples entry positions to set to breakeven using pips or target price when the trade is in your favor.

Multi Selllimit and Sellstop orders are script files that enable traders to place multiple orders with ease. These orders allow traders to enter the market at a specific price level, or at a specified number of pips away from the current market price, with stop-loss and take-profit levels. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. Moreover, the multi Selllimit and Sellstop orders offer traders the flexibility to customize their trading strategies. Traders can set the stop-loss level to zero if they do not use stop-loss, and can choose between a target price or a pip-based entry. This level of flexibility allows traders to tailor their trading strategies to their specific needs, which can result in better trading outcomes.

Multi buylimit and buystop orders are script files that enable traders to place multiple orders with ease. With just one command, traders can place multiple buylimit or buystop orders using either a target price or pips. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. This setup includes stop-loss and take-profit levels, which can be adjusted based on the trader's preferences. Notably, these orders come with a level of flexibility that enables traders to fine-tune their trading strategies. For instance, a trader can opt to set the stop-loss level to zero if they do not use stop-loss.

To assist traders who wish to open multiple sell orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Sell is the number of trades to execute. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple sell orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

To assist traders who wish to open multiple buy orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Buy is the number trades the trader wish to open instantly. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple buy orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

Below you can find a super simple method to create a license based on MT4 account name. Place in your init function: CheckLicense(); The stringLower method makes sure the account name is in lowercase. Then you can check this value with the account name you want to check.

Find what are the highs and the lows that happened the last 60000 ms

Convert historical data from M1 to M1, M5, M15, M30, H1, H4, D1, W1 and MN, specifying the start date.

this Script will get content message from Popup Alert dialog

A Simple Trade Management Script

This Script Closed All Open Orders At Once (Except Pending Orders)

Draw trade history onto chart

Plot entry and exit as line objects from MQL5 signal CSV onto chart

This Script is the example of using function LineNotify that use to send message to LINE APP via Line Notify service As the function LineNotify use webrequest to send HTTP request so it can be used in EA or Script program only , can't use in Indicator program

This simple quick & dirty script code will output a CSV file of all the Signals' properties as reported by the MQL4 Trade Signals functionality.

Just simple codes to Disable/Enable Auto/Algo-Trading in both MT5 and MT4. Of course, DLLs must be allowed, This cannot be done without DLLs

Export the history of transactions on the MT4 trading account.

Just a Basic Functions For BreakEven.

De nombreux développeurs sont confrontés au même problème : comment accéder au bac à sable du terminal de trading sans utiliser de DLL non sécurisées. L'une des méthodes les plus simples et les plus sûres consiste à utiliser des pipes nommés standard qui fonctionnent comme des opérations de fichier normales.

Eh bien, les fonctions d'opérations sur les fichiers sont utilisées dans la bibliothèque système de kernel32.dll. C'est cette bibliothèque que nous importons dans l'EA. Le code est joint.

Utilisez ce script pour créer vos propres périodes non standard.

Il est conçu pour créer une période de symbole non standard basée sur l'utilisation de la période standard.

Le script envoie SELL STOP à l'ordre en attente avec les données d'expiration et le numéro d'impression du ticket.

Modify pending order - script choisissant le premier dans la liste des ordres en attente, imprimant les données de l'ordre en attente sélectionné, modifiant l'ordre en attente et imprimant les données de l'ordre en attente après modification.

Modify - script choisissant en premier dans la liste des ordres d'achat ou de vente, imprimant les données de l'ordre sélectionné, modifiant l'ordre et imprimant les données de l'ordre après modification.

Delete pending order - script imprimant le premier élément sélectionné de la liste des ordres en attente et supprime l'ordre en attente.

Close - script fermant le premier ordre au marché s'il est le premier dans la liste.

Trade - script envoyant la commande ACHETER et imprimant les données de l'ordre sélectionné dans le journal.

123456789