Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Script

Export candles and indicators data to external csv file - script per MetaTrader 5

Visualizzazioni:
110
Pubblicato:
Aggiornato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

ExportDataToCSV is a lightweight and customizable MQL5 script designed to export historical price action data (OHLCV) and popular technical indicators directly to a .csv file.

Unlike static exporters that dump unnecessary data, this script uses dynamic handle initialization. It only creates indicator handles, waits for calculations, and writes columns for the specific parameters you enable in the input window—saving processing time and keeping your datasets clean for Excel, Python (Pandas/NumPy), R, or Machine Learning models.


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.

  • 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: 1000 ).

    • InpFileName : Output file name (default: "MT5Export.csv" ).

  • 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.

Net Currency Exposure and Hedged Margin Simulator Panel Net Currency Exposure and Hedged Margin Simulator Panel

A real-time CCanvas on-chart utility for MetaTrader 5 that calculates net lot exposure per currency across all open positions and simulates the exact margin, Margin Level (%), and Stop-Out buffer impact of a new Buy or Sell order—automatically accounting for your broker's hedged margin rules.

Prop Firm Daily Loss and Drawdown Monitor Prop Firm Daily Loss and Drawdown Monitor

Free panel indicator for funded / prop-firm accounts: shows the room left before the daily loss limit and the static maximum drawdown, and alerts when you get close. Monitor only: it never opens, closes or blocks trades.

Solfeo - the market as a score (candles to MIDI) Solfeo - the market as a score (candles to MIDI)

A script that turns candles into a MIDI file: one instrument per symbol, meter detected from the data, pitch from the move, duration from the candle body.

Periodic VWAP Bands Periodic VWAP Bands

Volume-weighted average price that resets every day, week or month, with two pairs of standard-deviation bands, the previous period's final VWAP and a panel showing how far price is from VWAP in price, points and sigma units.