Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

MQL5 Source Codes of Technical Indicators for MetaTrader 5

icon

MQL5 technical indicators analyze MetaTrader 5 price charts on Forex, as well as stock and commodity markets. Indicators define trend direction and power, overbought and oversold states, support and resistance levels. Underlying mathematical models provide objective assessment of the current market state allowing traders to accept or reject trading system's signals.

You can download and launch offered indicators in MetaTrader 5. The library of indicators is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

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

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.

Synchronized custom crosshair indicator showing price and (server/local) time.

Perfect Seconds chart indicator allows you to convert minute candles of live data into seconds. 1. Choose any number of seconds to close a bar with accurate time. 2. This is Live OHLC rates based data, It works even if ticks are not available. 3. No external DLL required, it works smoothly on VPS 4. Fast and optimized code 5. Supports Crypto Pairs such as BInance, Kucoin and all other exchanges where Futures live chart can be converted into seconds easily. 6. Support all type of symbols such as Gold and Forex pairs. 7. Options to delete symbol and rates.

This tool will calculate the acceptable lot size based on a stop loss distance and risk percentage

An indicator that dynamically calculates risk (in percentages and money) based on the lot size and stop loss

PTB

Indicator Description: PTB.mq5 Overview: The PTB.mq5 indicator for MetaTrader 5 calculates short-term and long-term high and low prices, along with Fibonacci retracement levels based on these extremes. Features: Short-Term High and Low: Identifies immediate support and resistance over a user-defined short length. Long-Term High and Low: Analyzes broader market trends over a longer period. Fibonacci Levels: Plots key retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) for potential reversal points. Input Parameters: shortLength: Number of candles for short-term calculation. longLength: Number of candles for long-term calculation. Visual Representation: Distinct colors and widths for each line to differentiate between high/low and Fibonacci levels. Usage: Helps traders identify entry/exit points and monitor market trends based on historical price levels.

Copy and paste selected graphical objects between charts via Windows clipboard as text. Use Ctrl+Q on a source chart, then Ctrl+J on a target chart.

Alerts on trendline break

3 Ema moving averages identify trend change with rsi confirm

Engulfing Bar Occurs below Ema moving Average that is rising - Buy Trade -

Rsi Indicator

This is an indicator that combines swing high/low and Fibonacci Retracement to identify potential buying zones.

This is an indicator that helps identify Engulfing candle patterns.

The Fair Value Gap (FVG) Indicator identifies price gaps that occur when there is an imbalance between buying and selling pressure. It highlights areas where price is likely to return to fill the gap, providing potential trade entry points based on market inefficiencies.

High and Low Line Indicator

A customized bid and ask line which is labelled and clear to help visualize the bid and ask prices

The Swing High/Low Identifier for MetaTrader 5 marks significant swing highs and swing lows directly on your chart with color-coded arrows. This tool helps traders quickly identify key price levels, which can serve as resistance and support, and is ideal for trend reversal analysis, support and resistance mapping, and enhancing price action strategies. By highlighting these crucial swing points, it provides valuable insights for making informed trading decisions and optimizing trading strategies.

higher confidence to get into trade

A demonstration on how to modify objects in an indicator without having the source code

main point is changing of MA curve to horizontal line and DPO curve shall represent to distance from close price to zero level or MA curve

This Indicator creates automatically a Risk/Reward Box on you all opened chart base on High, Low price with the old candles. You can use it easily to drag and change size and price to your desire wanted.

Indicator displays the value of defined stop loss and or take profit in the deposit currency. Note: It calculates an estimated value based on a simple calculation and does not take into account brokerage commissions.

This indicator is designed to draw a Fibonacci retracement, using as a basis the ZigZag indicator.

Beginner tutorial on CCI to learn to code in MQL5

Linear Regression Value indicator with an option that allows it to be applied to another indicator

Bollinger Bands with controllable outer band smoothing (post smoothing)

Bollinger Bands with controllable outer band smoothing (pre smoothing)

This code does not trace the iatr() because the iatr() or this code is a more modern version. This code uses original smoothing, a kind of SMA and not wilder smoothing. The analysis of the two smoothings can suggest opportunities elsewhere

Linear regression line with an option to be applied to another indicators

Linear Regression Line

Linear Regression Slope

Linear Regression Value indicator

RSI adaptive indicator based on tick calculations

MovingAverages.mqh Part II A multi timeframe version is available with colors for orientation, for developers or profitable traders for free. Offer under conditions. Other multi timeframe indicators are also available.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134