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 MQL5 des Expert Advisors pour MetaTrader 5 - 2

icon

Les Expert Advisors analysent les graphiques de prix et effectuent des transactions automatiquement en suivant les règles sous-jacentes. Vous trouverez ici des codes sources MQL5 permettant de résoudre divers problèmes. Vous pouvez sélectionner aussi bien des Expert Advisors simples basés sur le croisement de moyennes mobiles que des Expert Advisors complexes impliquant des algorithmes compliqués de génération de signaux et une protection contre les erreurs de trading.

Vous pouvez télécharger et lancer les Expert Advisors proposés dans MetaTrader 5. Il est recommandé de tester et d'optimiser les robots de trading dans le testeur de stratégie avant de les utiliser. La bibliothèque d'Expert Advisors est également disponible directement depuis la plateforme MetaTrader 5 et l'environnement de développement MetaEditor.

Soumettre votre code

Dans la partie 6 de la "Programmation MQL5 pour les traders", nous étudierons un élément clé du langage MQL5 : l'automatisation du trading. Nous commencerons par une description des entités fondamentales, telles que les spécifications des instruments financiers et les paramètres du compte de trading. Il s'agit de conditions préalables à la création d’Expert Advisors fonctionnant correctement.

Dans la cinquième partie du livre, nous approfondirons les API associées au trading algorithmique, notamment l'analyse et le traitement des données financières, la visualisation des graphiques, l'automatisation et les interactions avec les utilisateurs.

Dans la quatrième partie du livre, nous nous concentrerons sur la maîtrise des fonctions intégrées (API MQL5) et nous nous pencherons progressivement sur les sous-systèmes spécialisés. Tout programme MQL5 peut utiliser de nombreuses technologies et fonctionnalités. Il est donc logique de commencer par les fonctions les plus simples et les plus utiles qui peuvent être utilisées dans la plupart des programmes.

La partie 3 "Programmation Orientée Objet en MQL5" propose une immersion dans le monde de la programmation orientée objet (POO) dans le langage MQL5. Le développement de logiciels implique souvent une complexité liée à la gestion d'entités multiples, nécessitant une technologie avancée pour améliorer la facilité de programmation, la productivité et la qualité.

La partie 2 "Fondamentaux de la programmation MQL5" est une introduction aux concepts clés de ce langage de programmation. Cette partie du livre est consacrée aux types de données, aux identificateurs, aux variables, aux expressions et aux opérateurs. Vous apprendrez à combiner différentes instructions pour former la logique du programme.

Le premier chapitre du livre présente le langage et l'environnement de développement MQL5. L'une des nouveautés introduites dans le langage MQL5 par rapport à MQL4 (langage MetaTrader 4) est la prise en charge de la Programmation Orientée Objet (POO), ce qui le rend similaire au C++.

a Simple Visual Strategy Tester / Manual Trade Training using Martingale.

Cet Expert Advisor ne fait pas de transactions. Un simple panneau, implémenté à l'aide de la bibliothèque standard Canvas, vous permet de dessiner des chiffres à l'aide de la souris. Le modèle mnist.onnx formé est utilisé pour reconnaître les chiffres.

This is an mql5 Expert Advisor trading the breakouts and using Martin Gale risk management.

This function allows you to retrieve and return the filling policy of a symbol in MetaTrader 5. This is useful for making trading decisions based on the filling policy of a specific financial instrument.

"This advisor uses the RSI indicator to determine optimal entry and exit points in the market. A unique feature of the advisor is its martingale strategy, which allows for position reversal with an increased lot size during market reversals. The advisor offers flexible trading time settings: you can set a working time range and disable trading during specific hours to filter out news events."

The EA trades using the Rectangle, EMA and SMA indicators.

On contrast with Trailing Stop which a stop loss trails price until the price hits the stop loss and the position gets closed in profit, introducing Trailing Take Profit which take profit trails price when a position is in loss and ultimately the position gets closed with loss.

The AK-47 Scalper EA is fully automated. It employs a strategy of continuously entering Sell Stop orders and will modify them when the price moves against the pending orders.

Explore the implementation of equity-based position closure in your trading bot, where positions are closed automatically when the equity reaches a certain percentage threshold.

To use martingale money management when a position is in loss and price hits any of specific distances.

This code snippet implements a dynamic risk management strategy for existing trades. It focuses on closing trades based on profit or loss thresholds and employs a trailing stop loss to lock in profits as the trade moves favorably. The strategy helps manage risk and enhance profitability in a streamlined manner.

This MT5 Expert Advisor opens multiple buy and sell orders based on user input, featuring a simple interface with Buy and Sell buttons. The EA calculates lot size, checks the spread against slippage, and places orders accordingly. It is essential to test this EA in a demo account before using it in live trading.

This code initializes the necessary objects and input parameters, and defines a CheckTrades() function that calculates the risk and profit amounts based on the account balance and user input. It then iterates through open orders and checks if the current profit or loss meets the user-defined thresholds, and closes the position if necessary

This class allows you to create buttons on the chart as if they were chart objects(have time and price coordinates) these objects can be dragged on the chart and when scrolling they stay at the same place. If you wan't to learn some Object Oriented Programming or if you wan't to understand how chartevents work or you wan't to create graphical interfaces, you can learn a lot from this.

Close trades when the percentage profit or risk of the account is reached

to display trade history files(.csv) on charts.

MoveStoploss moves the stoploss as the trade move in your direction at a specific distance. Version 1.1 has automatic trail error fixed.

Returns the price for the most recent fractal high

Official example involve complex wrapper classes, Here is a simple one

This expert advisor is based on the alligator indicator and bollinger bands indicator. Currency pair: GBPAUD Time frame: 15min

Reversal strategy using Moving Average, Standard Deviation and RSI

US: This is a very simple code regarding an information panel. It doesn't use external files or anything like that! simply copy and paste it into your code the way the code was written. The dashboard displays; Active asset price Your position(Bought or sold) Maximum and minimum price of the asset Username open profit Balance PT-Br:Esse é um codigo bem simples a respeito de um painel de informações. Não utiliza arquivos externos ou algo do tipo! simplesmente, copie e cole no seu codigo da forma que o codigo foi escrito. O painel exibe; Ativo Preço do ativos Sua posição(Comprada ou vendida) Preço max e minimo do ativo Nome do usuario Lucro em aberto Saldo

Rsi close/ mtf use

MTF divergence settings

The DD_Relative function calculates the drawdown (relative loss) of the current trading account in percentage. To do this, it uses the Current_LossOrProfit() function to get the current profit or loss for all open positions and divides it by the current account balance. The result is rounded to two decimal places and displayed in the chart comment. The Current_LossOrProfit() function loops through all open positions in the account and adds the commission, swap, and current profit or loss for each position. The result is rounded to two decimal places and returned as the current profit or loss of all open positions.

The function takes two arrays of integers as parameters: "allowedPeriods" and "periodsToCheck". "allowedPeriods" is an array containing all the time periods allowed by the system, while "periodsToCheck" is an array containing the time periods used by the user in the indicator. The function iterates through the elements of the "periodsToCheck" array and checks if each of them is present in the "allowedPeriods" array. If it finds any time period that is not allowed, the function returns "false". If all time periods are allowed, the function returns "true". In short, this function is used to make sure that the time periods used in an indicator are valid and allowed by the system.

a Template for Multicurrency system for Metatrader 5

Strategy that uses the CCI indicator 0-line cross to spot trades and the MACD indicator to confirm them.

Forex Trade Manager MT5 simplifies managing open orders in MetaTrader 5.

Forex Trade Manager Grid MT5 helps you to managing orders and achieve the goal.

RSI Bot, send alert buy when RSI<=20, send alert sell when RSI>=80

Parmis les 5% des traders les plus performant du desk ''Options Dérivées'' de la Société Générale. PnL 22MEUR entre 01/01/2022 au 27/12/2022

- This Bot use stratery Breakout of Daily Bar, I tested for 3 Pair currency : GBPUSD, EURUSD, XAUUSD - Default setting is not sure the best, you can test for your parameter. - This is version for MT5 that convert from MT4 - this EA is best for broker low spread

A simple and easy to understand function that calculates todays profit, written to the Expert Journal.

123456789...36