Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Accedi al CodeBase dal tuo terminale MetaTrader 5
Non hai trovato il codice che fa per te? Ordinane uno dalla sezione Freelance
Come scrivere un Expert Advisor o un indicatore

Libreria di Codici Sorgente MQL5 per MetaTrader 5 - 7

icon

Questa è la più grande libreria di codici sorgente gratuiti per i programmi della piattaforma MetaTrader 5. Qui puoi trovare Expert Advisors, indicatori tecnici, script e librerie pronti all'uso. Sfrutta la libreria di codici per imparare il linguaggio MQL5 e sviluppa le tue applicazioni di trading automatico partendo dai codici disponibili.

I codici possono essere liberamente scaricati, testati e lanciati in MetaTrader 5. La libreria è anche disponibile direttamente dalla piattaforma MetaTrader 5 e dall'ambiente di sviluppo MetaEditor.

Invia il tuo codice

Bollinger Squeeze Basic MetaTrader indicator — is a complex indicator based on Momentum, Bollinger bands, and Keltner channel. The indicator is drawn in the separate window of the chart as a Momentum histogram and a range of dots when show the relationship between the current Bollinger bands and Keltner channel values. This indicator is available for both MT4 and MT5 versions of the trading platform.

Bollinger Squeeze Advanced MetaTrader indicator — is a complex indicator consisting of two components: A measure of trendedness based on the Bollinger bands and Keltner channel "squeeze". A trend direction and strength histogram based on one of the following eight oscillators: Stochastic, CCI, RSI, MACD, Momentum, Williams % Range, ADX, DeMarker.

BMA MetaTrader indicator or Band Moving Average — was created by using the original moving average indicator and the idea from one of the site's visitors. The indicator displays itself in the form of three lines: the central one is the standard MT4/MT5 moving average (which can be simple, exponential or weighted), the upper line is the same as the central one but lifted up by 2% (by default), the lower line is the same as the central one but pushed down by 2%. Those two additional lines serve as the support and resistance levels. The indicator is available for both MT4 and MT5.

Beginner MetaTrader indicator — a very simple custom indicator that displays the local tops and bottoms on the chart with the red and blue dots near them. It analyzes the maximum and minimums on the certain period and then compares them to the range, in which the currency pair was trading, and if the top/bottom is significant enough, it marks it with the dot. This indicator redraws itself and thus should not be used for generating trading signals as the dots' positions may change. Both MT4 and MT5 versions of the indicator are available.

BB MACD MetaTrader indicator — is a basic MACD (Moving Average Convergence Divergence) indicator variation, which helps in detecting the trend change points and measuring the current trend's strength. The indicator is drawn in the separate window on the chart and consists of two lines (blue and red) and the dots, which can be either green or magenta. The change of the dots' color is a good signal provider, while the width of gap between the two lines indicates the strength of the current trend. This indicator is available for MT4 and MT5.

Basing Candlesticks MetaTrader indicator — is an automatic indicator that detects and marks basing candles on the chart. A basing candle is a candle with body length less than 50% of its high-low range. The indicator highlights the basing candles using histogram lines (in MT4) or custom candles (in MT5) directly in the main chart of the platform. The percentage criterion can be changed via input parameters. You can also turn on alerts for when a new basing candle appears.

Aroon Up & Down MetaTrader indicator — detecting the local tops and bottoms of the chart it was applied to, this indicator provides the signals for buying and selling the currency pairs when they rise up from the bottom and fall from the top. The cross of the indicator lines provide a good signal to take the profit or to exit with a minimum loss. This indicator can send sound and e-mail alerts on the cross. It is available in both MT4 and MT5 versions.

3rd Generation Moving Average is an advanced version of the standard moving average (MA) indicator for MetaTrader. It implements a rather simple lag-reducing procedure based on the longer MA period. The method was first described by M. Duerschner in his article Gleitende Durchschnitte 3.0 (in German). The presented version uses λ = 2, which provides the best possible lag-reducing. Higher λ increases similarity with the classic moving average. The indicator is available for both MT4 and MT5. It does not require using any DLL

Breakeven Line Indicator is a MetaTrader indicator that calculates breakeven level based on all open positions and displays it on your chart as a horizontal line. Additionally, it will calculate the total number trades, the total number of lots, and the distance to the breakeven line in points and profit/loss. The indicator is available for both MT4 and MT5.

Negative Volume Index (NVI) is a free technical indicator for advanced chart analysis in MT4, MT5 platforms. It is based on tick volume (can be substituted with real volume in MT5) and has two useful features added: Support for multi-timeframe (MTF) operation. Can be switched to show Positive Volume Index.

Candle Range MetaTrader indicator — is a very simple and lightweight indicator that displays the candle's range in pips on mouseover. In addition, to the High/Low range, it can optionally display the body size (Open/Close) for candles. Multiple display parameters are available to control how the indicator looks. This indicator is available for both MT4 and MT5 versions of the trading platform.

An MQL5 Expert Advisor that reacts to high-impact forex news events using the MQL5 Calendar. It identifies news related to inflation (CPI/PPI) and interest rate decisions, placing breakout trades with pending orders. Ideal for traders looking to automate news-based strategies. (This is just a starting point)

An advancement of the MetaQuotes zigzag with an oscillator mode, current bar leg tracking, fib levels, and dynamic scaling

Unfortunately, I discovered that some brokers are a bit sloppy with the server time change due to the daylight saving time (DST), which I did not expect and which surprised me a lot. Here is a script with which anyone can check their broker.

Symbol Swap Panel: Effortlessly switch the active symbol on your chart while simultaneously adding the new symbol to Market Watch. This tool ensures seamless integration and access to real-time market data, optimizing your trading workflow.

The Trend Equilibrium Indicator TrendEQ dynamically analyzes market movements by combining momentum and volatility. By scaling momentum with the market’s volatility, the TrendEQ provides a reliable measure of trend strength and direction.

This is a indicator displaying candlesticks patterns on a chart.

This script was developed for displaying saved Strategy report from the Strategy Tester into a chart.

BollingerBandsEA trades according to Bollinger Bands.

This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. It is ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. This is a customizable starting point to adapt to any specific needs.

Copy these into any EA you are busy coding and you"ll have a trailing sl the only things you'll need to change would probably be InpMagic for your magic number or you could just copy my code as is , Remember to add COrderinfo ord; and CPositionInfo pos;

Prototype for data collection. Dummy buffers for the data window (for data collection purposes) for the hour of the day, and an additional buffer for the hour of the day. Comments the hour of the day.

Creating profit labels on deals (closed trades) which also show in the strategy tester

Price increase Indicator

MarketPredictor for MetaTrader 5 The MarketPredictor is an innovative Expert Advisor (EA) for MetaTrader 5 that leverages mathematical models such as sine functions, Fast Fourier Transform (FFT), sigmoid functions, and Monte Carlo simulations to analyze and predict market movements. This project is designed for developers, math enthusiasts, and traders interested in combining technological and financial innovations. Feel free to suggest, discuss, and implement code ideas directly in this thread. Whether it’s new features, improvement suggestions, or strategies – every contribution is welcome to further develop and optimize the MarketPredictor. You’re also welcome to add me to clarify questions privately, collaborate on the GitHub project, or send me your feedback directly. Let’s cook up something amazing together and take this project to the next level!

High-performmance functions for dealing with time.

This Fibonacci Bollinger Bands indicator is a conversion from Pine Script (by Rashad) to the MQL5 language.

Optimal closing tool with Bollinger Bands and RSI.

The script MinMargins.mq5 is designed to help traders quickly calculate and document the minimum amount of money required to open a position with the smallest lot size for all symbols available in the Market Watch. This data is saved to a CSV file for easy review and analysis.

A new interface library has been developed to simplify the process of converting MT4 indicators and Expert Advisors (EAs) to MT5. This library supports most of the MetaTrader 4 functions, offering developers a unified solution for cross-platform compatibility.

The SUPERMACBOT is a fully automated trading robot that combines the power of the Moving Average Crossover strategy with the MACD Indicator to deliver precise and reliable trade signals. This Expert Advisor is designed to work seamlessly on all symbols and timeframes, offering versatility and adaptability for traders across various market conditions.

A simple replacement for a comment. Works in the tester 50 times faster than the standard function.

A smoother line chart which cuts out a lot of the market noise and uses volume in the formula

this is a copier template

This indicator displays current events on the chart and allows you to export the calendar to archives for backtesting, automatically fixing time discrepancies between the history of bars and the history of events. This is an improved version of CalendarMonitorCached indicator from the algotrading book.

Marking the extreme highs and lows (OHLC) together with the extreme bid and ask prices

The code above is a "Hammer" indicator that detects candlestick hammer formations (bullish and bearish) and inverted hammer formations (bullish and bearish) on a MetaTrader 5 chart. This indicator identifies price reversal patterns by calculating the size and ratio of the candlestick wicks based on adjustable parameters: MaxRatioShortWick, MinRatioLongWick, and MinCandleSize. When a pattern is detected, the indicator displays a colored arrow near the candle’s lowest or highest price according to the pattern’s direction. The code also includes functions to create and delete objects automatically when the indicator is initialized or stopped.

WeekDays indicator displays Day Of Week, Week Of Year, Day Of Year or Bar Index in the Data Window, and optionally in labels on the chart.

The AutoFibo indicator is an advanced Fibonacci retracement tool that automatically draws Fibonacci levels based on the ZigZag pattern. This indicator is designed to help traders quickly identify potential support and resistance levels in trending markets.

This service periodically checks swaps for predefined symbols and saves detected changes into CSV-files for further analysis and potential replay (not implemented here). Also it monitors and alerts swap changes of existing positions.

1234567891011121314...190