{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"mt5cli \u00b6 Command-line tool for MetaTrader 5 data export. Overview \u00b6 mt5cli is a CLI application that exports MetaTrader 5 trading data to multiple file formats. It is built on top of pdmt5 , a pandas-based data handler for MetaTrader 5. Features \u00b6 Multi-format export : CSV, JSON, Parquet, and SQLite3 output formats Auto-detection : Format detection from file extensions Comprehensive data access : Rates, ticks, account info, symbols, orders, positions, and trading history Flexible timeframes : Named timeframes (M1, H1, D1, etc.) and numeric values Connection management : Optional credentials, server, and timeout configuration Installation \u00b6 pip install mt5cli Quick Start \u00b6 # Export account information to CSV mt5cli -o account.csv account-info # Export EURUSD M1 rates to Parquet mt5cli -o rates.parquet rates-from --symbol EURUSD --timeframe M1 \\ --date-from 2024 -01-01 --count 1000 # Export ticks to JSON mt5cli -o ticks.json ticks-from --symbol EURUSD \\ --date-from 2024 -01-01 --count 500 --flags ALL # Export symbols to SQLite3 with custom table name mt5cli -o data.db --table symbols symbols --group \"*USD*\"#Exportwithconnectioncredentialsmt5cli--login12345--passwordmypass--serverMyBroker-Demo\\-opositions.csvpositionsCommands\u00b6Rates\u00b6CommandDescriptionrates-fromExportratesfromastartdaterates-from-posExportratesfromastartpositionrates-rangeExportratesforadaterangeTicks\u00b6CommandDescriptionticks-fromExportticksfromastartdateticks-rangeExportticksforadaterangeInformation\u00b6CommandDescriptionaccount-infoExportaccountinformationterminal-infoExportterminalinformationversionExportMetaTrader5versioninformationlast-errorExportthelasterrorinformationsymbolsExportsymbollistsymbol-infoExportsymboldetailssymbol-info-tickExportthelasttickforasymbolmarket-bookExportmarketdepth(orderbook)Trading\u00b6CommandDescriptionordersExportactiveorderspositionsExportopenpositionshistory-ordersExporthistoricalordershistory-dealsExporthistoricaldealsorder-checkCheckfundssufficiencyforatraderequestorder-sendSendatraderequesttothetradeserver(--yesrequired)Useorder-checktovalidatearequestpayloadbeforerunningorder-send--yes.BulkCollection\u00b6CommandDescriptioncollect-historyCollectrates,ticks,history-orders,andhistory-dealsforoneormoresymbolsintoasingleSQLitedatabase(optionalcash-event/positionviews)mt5cli-ohistory.dbcollect-history\\--symbolEURUSD--symbolGBPUSD\\--date-from2024-01-01--date-to2024-02-01\\--datasetrates--datasethistory-deals\\--timeframeM1--flagsALL--if-existsappend--with-viewscollect-historyoptions:OptionDefaultDescription--symbol/-srequiredSymboltocollect(repeatformultiple).--date-fromrequiredStartdateinISO8601.--date-torequiredEnddateinISO8601.--datasetallfourRepeatable:rates,ticks,history-orders,history-deals.--timeframeM1Ratestimeframe;recordedinatimeframecolumnontheratestable.--flagsALLTickcopyflagsforwardedtocopy_ticks_range.--if-existsfailappend,replace,orfailwhenatargettablealreadyexists.--with-viewsoffAddcash_eventsandpositions_reconstructedviews(requiresthehistory-dealsdataset).Historyordersanddealsarefetchedpersymbolandconcatenated,sothesymbolfilterisappliedconsistentlyacrossalldatasets.Thecash_eventsviewisderivedfromsymbol-filteredhistory_deals,soaccount-levelcasheventswithemptyornon-matchingsymbolsmaybeexcluded.Thepositions_reconstructedviewexcludespositionswithnoclosingdeal,usesvolume-weightedopen/closeprices,andreportsreversaldeals(DEAL_ENTRY_INOUT)viavolume_reversal/reversal_count.GlobalOptions\u00b6OptionDescription-o,--outputOutputfilepath(required)-f,--formatOu