Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 5 Script | Export candles and indicators data to external csv file | Free Download

Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.

Image for Export candles and indicators data to external csv file

Key Features:

  • Selective Export (Checkboxes): Choose exact data columns to include via boolean inputs (true /false ).

  • Resource Efficient: Only initializes and calculates indicators that are explicitly selected by the user.

    Grid trading done right – try the robust Grid Expert Advisor for controlled risk. Details here.

  • Built-in Synchronization: Includes a safe waiting loop (BarsCalculated ) to ensure all selected indicator buffers are completely calculated before writing to the file.

  • Clean CSV Formatting: Automatically generates dynamic headers matching your selected inputs, along with formatted timestamps (YYYY.MM.DD HH:MM ).

Available Data & Indicators:

  • Timestamp: Bar date and time (exported by default under the column Date_Time ).

  • Price Action: Open, High, Low, Close (OHLC).

  • Volume: Tick Volume.

  • Volatility & Trend:

    • ATR (14)

    • ADX (14) — exports Main, +DI, and -DI buffers

  • Momentum & Oscillators:

    • RSI (7) and RSI (14)

    • MACD (12, 26, 9) — exports Main and Signal lines

    • Stochastic (5, 3, 3) — exports Main and Signal lines

    • CCI (14)

    • Momentum (14)

    • MFI (14)

Input Parameters:

  • General Settings:

    • InpCandles : Number of historical bars to export (default:).

    • InpFileName : Output file name (default:).

  • Data to Export: Individual true /false toggles for OHLC, Tick Volume, and each of the 9 technical indicators.

How to Use & Where to Find the File:

  1. Attach the script to any chart with your desired symbol and timeframe.

  2. Check the boxes for the data/indicators you want to export and set the number of candles.

  3. Click OK and check the Experts tab in the Terminal for the confirmation message.

  4. Retrieve your CSV file in MetaTrader 5 via:File -> Open Data Folder -> MQL5 -> Files.

Level up your trading with professional RobotFX expert advisors and indicators. Visit robotfx.org for proven MT4/MT5 tools.

79915

Best MetaTrader Indicators + Profitable Expert Advisors