Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
415
Rating:
(4)
Published:
2025.06.17 12:05
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Key Features

  1. Week selection:

    • The SelectedWeek parameter defines which week of the month will be numbered.

    • If SelectedWeek = 0, all weeks are considered, and all candles will be numbered.

    • For non-zero values, only the candles of the specified week will be numbered.

  2. Reverse Count:

    • When NumberFirstCandle = false , numbering starts at the last candle of the day and proceeds backwards.

  3. Dynamic Filtering:

    • The indicator filters candles based on the selected week ( SelectedWeek ) and ignores the others.

  4. Dynamic Text Positioning:

    • The numbers are positioned above or below the candles, depending on whether the candle is bullish or bearish.

    • The spacing between the text and the candle is controlled by the PriceOffsetFactor parameter.

  5. Visual customisation:

    • Colours, font, text size and anchor type can be adjusted to enhance the appearance.

  6. Optimised Performance:

    • The indicator deletes old chart objects before creating new ones, ensuring that there is no unnecessary overhead on the chart.


Input Parameters

PriceOffsetFactor

Dynamic spacing factor between text and candle.

0.5

InpTextColourAbove

Colour of the text above the candle (for bullish candles).

clrSpringGreen

InpTextColourBelow

Colour of the text below the candle (for bearish candles).

clrMediumOrchid

InpFont

Type of font used to display the numbers.

"Arial"

InpFontSize

Font size.

8

Anchor

Type of anchor for positioning the text (centre, top, bottom, etc.).

ANCHOR_CENTER

NumberFirstCandle

Defines whether the count starts on the first candle of the day ( true ) or the last ( false ).

true

SelectedWeek

Week selected for counting (0 = Every week).

1



Detailed Features

1. Filtering by Week

  • The GetWeekOfMonth() function calculates the week of the month for each candle.

  • The condition if(SelectedWeek != 0 && currentWeek != SelectedWeek) ensures that only candles from the selected week are processed.

2. Sequential counting

  • The count restarts whenever there is a change of day ( candleDay != previousDay ).

  • If NumberFirstCandle = true , the count starts on the first candle of the day.

  • If NumberFirstCandle = false , the count starts at the last candle of the day and continues backwards.

3. Text positioning

  • The text is positioned above the candle if the closing price is lower than the opening price (bearish candle).

  • The text is positioned below the candle if the closing price is higher than the opening price (bullish candle).

4. Creating and Updating Chart Objects

  • The CreateText() function creates or updates chart objects on the chart.

  • The objects are uniquely named using the ObjectPrefix prefix to avoid conflicts.

5. Automatic Cleaning

  • The DeleteObjects() function removes all graphical objects created by the indicator when it is removed or reinitialised.



Translated from Portuguese by MetaQuotes Ltd.
Original code: https://www.mql5.com/pt/code/56432

Moving Average based on Heiken-Ashi Moving Average based on Heiken-Ashi

This is a Moving Average indicator based on Heiken-Ashi candles instead of raw market price.

TradeReportExporter TradeReportExporter

The TradeReportExporter script is designed to export the history of trades (trades) into a convenient CSV file. It automatically collects data on all trades for the last year for the instrument it is installed on. The file includes such data as date and time, transaction type (buy/sell), price, volume, commission and profit/loss. The result is saved in a file that can be opened in Excel or any other spreadsheet editor.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.