{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"mt5cli","text":"
Command-line tool for MetaTrader 5 data export.
"},{"location":"#overview","title":"Overview","text":"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.
"},{"location":"#features","title":"Features","text":"pip install mt5cli\n"},{"location":"#quick-start","title":"Quick Start","text":"# Export account information to CSV\nmt5cli -o account.csv account-info\n\n# Export EURUSD M1 rates to Parquet\nmt5cli -o rates.parquet rates-from --symbol EURUSD --timeframe M1 \\\n --date-from 2024-01-01 --count 1000\n\n# Export ticks to JSON\nmt5cli -o ticks.json ticks-from --symbol EURUSD \\\n --date-from 2024-01-01 --count 500 --flags ALL\n\n# Export symbols to SQLite3 with custom table name\nmt5cli -o data.db --table symbols symbols --group \"*USD*\"\n\n# Export with connection credentials\nmt5cli --login 12345 --password mypass --server MyBroker-Demo \\\n -o positions.csv positions\n"},{"location":"#commands","title":"Commands","text":""},{"location":"#rates","title":"Rates","text":"Command Description rates-from Export rates from a start date rates-from-pos Export rates from a start position rates-range Export rates for a date range"},{"location":"#ticks","title":"Ticks","text":"Command Description ticks-from Export ticks from a start date ticks-range Export ticks for a date range"},{"location":"#information","title":"Information","text":"Command Description account-info Export account information terminal-info Export terminal information symbols Export symbol list symbol-info Export symbol details"},{"location":"#trading","title":"Trading","text":"Command Description orders Export active orders positions Export open positions history-orders Export historical orders history-deals Export historical deals"},{"location":"#global-options","title":"Global Options","text":"Option Description -o, --output Output file path (required) -f, --format Output format (auto-detected from extension if omitted) --table Table name for SQLite3 output (default: \"data\") --login Trading account login --password Trading account password --server Trading server name --path Path to MetaTrader5 terminal EXE file --timeout Connection timeout in milliseconds --log-level Logging level (DEBUG, INFO, WARNING, ERROR)"},{"location":"#requirements","title":"Requirements","text":"Browse the API documentation for detailed module information:
This project follows strict code quality standards:
MIT License - see LICENSE file for details.
"},{"location":"api/","title":"API Reference","text":"This section contains the complete API documentation for mt5cli.
"},{"location":"api/#modules","title":"Modules","text":"The mt5cli package consists of the following modules:
"},{"location":"api/#cli","title":"CLI","text":"Command-line interface module providing typer-based commands for exporting MetaTrader 5 data to CSV, JSON, Parquet, and SQLite3 formats.
"},{"location":"api/#architecture-overview","title":"Architecture Overview","text":"The package follows a simple architecture built on top of pdmt5:
cli.py): Typer application with subcommands for each data type, custom Click parameter types for datetime/timeframe/tick flags parsing, and format detection/export utilities.pdmt5): Uses Mt5DataClient and Mt5Config from the pdmt5 package for all MetaTrader 5 data access.All modules follow these conventions:
# Export account information to CSV\nmt5cli -o account.csv account-info\n\n# Export EURUSD H1 rates to Parquet\nmt5cli -o rates.parquet rates-from --symbol EURUSD --timeframe H1 \\\n --date-from 2024-01-01 --count 1000\n\n# Export ticks to JSON\nmt5cli -o ticks.json ticks-from --symbol EURUSD \\\n --date-from 2024-01-01 --count 500 --flags ALL\n\n# Export to SQLite3 with custom table name\nmt5cli -o data.db --table symbols symbols --group \"*USD*\"\n"},{"location":"api/#python-api","title":"Python API","text":"from mt5cli import detect_format, export_dataframe\nimport pandas as pd\n\n# Detect output format from file extension\nfmt = detect_format(Path(\"output.parquet\")) # Returns \"parquet\"\n\n# Export a DataFrame\ndf = pd.DataFrame({\"symbol\": [\"EURUSD\"], \"bid\": [1.1234]})\nexport_dataframe(df, Path(\"output.csv\"), \"csv\")\n"},{"location":"api/#examples","title":"Examples","text":"See individual module pages for detailed usage examples and code samples.
"},{"location":"api/cli/","title":"CLI Module","text":""},{"location":"api/cli/#mt5cli.cli","title":"mt5cli.cli","text":"Command-line interface for MetaTrader 5 data export.
"},{"location":"api/cli/#mt5cli.cli.DATETIME_TYPE","title":"DATETIME_TYPEmodule-attribute","text":"DATETIME_TYPE = _DateTimeType()\n"},{"location":"api/cli/#mt5cli.cli.TICK_FLAGS_TYPE","title":"TICK_FLAGS_TYPE module-attribute","text":"TICK_FLAGS_TYPE = _TickFlagsType()\n"},{"location":"api/cli/#mt5cli.cli.TICK_FLAG_MAP","title":"TICK_FLAG_MAP module-attribute","text":"TICK_FLAG_MAP: dict[str, int] = {\n \"ALL\": 1,\n \"INFO\": 2,\n \"TRADE\": 4,\n}\n"},{"location":"api/cli/#mt5cli.cli.TIMEFRAME_MAP","title":"TIMEFRAME_MAP module-attribute","text":"TIMEFRAME_MAP: dict[str, int] = {\n \"M1\": 1,\n \"M2\": 2,\n \"M3\": 3,\n \"M4\": 4,\n \"M5\": 5,\n \"M6\": 6,\n \"M10\": 10,\n \"M12\": 12,\n \"M15\": 15,\n \"M20\": 20,\n \"M30\": 30,\n \"H1\": 16385,\n \"H2\": 16386,\n \"H3\": 16387,\n \"H4\": 16388,\n \"H6\": 16390,\n \"H8\": 16392,\n \"H12\": 16396,\n \"D1\": 16408,\n \"W1\": 32769,\n \"MN1\": 49153,\n}\n"},{"location":"api/cli/#mt5cli.cli.TIMEFRAME_TYPE","title":"TIMEFRAME_TYPE module-attribute","text":"TIMEFRAME_TYPE = _TimeframeType()\n"},{"location":"api/cli/#mt5cli.cli.app","title":"app module-attribute","text":"app = Typer(\n name=\"mt5cli\",\n help=\"Export MetaTrader5 data to CSV, JSON, Parquet, or SQLite3.\",\n)\n"},{"location":"api/cli/#mt5cli.cli.logger","title":"logger module-attribute","text":"logger = getLogger(__name__)\n"},{"location":"api/cli/#mt5cli.cli.LogLevel","title":"LogLevel","text":" Bases: StrEnum
Logging verbosity levels.
"},{"location":"api/cli/#mt5cli.cli.LogLevel.DEBUG","title":"DEBUGclass-attribute instance-attribute","text":"DEBUG = 'DEBUG'\n"},{"location":"api/cli/#mt5cli.cli.LogLevel.ERROR","title":"ERROR class-attribute instance-attribute","text":"ERROR = 'ERROR'\n"},{"location":"api/cli/#mt5cli.cli.LogLevel.INFO","title":"INFO class-attribute instance-attribute","text":"INFO = 'INFO'\n"},{"location":"api/cli/#mt5cli.cli.LogLevel.WARNING","title":"WARNING class-attribute instance-attribute","text":"WARNING = 'WARNING'\n"},{"location":"api/cli/#mt5cli.cli.OutputFormat","title":"OutputFormat","text":" Bases: StrEnum
Supported output file formats.
"},{"location":"api/cli/#mt5cli.cli.OutputFormat.csv","title":"csvclass-attribute instance-attribute","text":"csv = 'csv'\n"},{"location":"api/cli/#mt5cli.cli.OutputFormat.json","title":"json class-attribute instance-attribute","text":"json = 'json'\n"},{"location":"api/cli/#mt5cli.cli.OutputFormat.parquet","title":"parquet class-attribute instance-attribute","text":"parquet = 'parquet'\n"},{"location":"api/cli/#mt5cli.cli.OutputFormat.sqlite3","title":"sqlite3 class-attribute instance-attribute","text":"sqlite3 = 'sqlite3'\n"},{"location":"api/cli/#mt5cli.cli.account_info","title":"account_info","text":"account_info(ctx: Context) -> None\n Export account information.
Source code inmt5cli/cli.py @app.command()\ndef account_info(ctx: typer.Context) -> None:\n \"\"\"Export account information.\"\"\"\n _execute_export(ctx, lambda c: c.account_info_as_df())\n"},{"location":"api/cli/#mt5cli.cli.detect_format","title":"detect_format","text":"detect_format(\n output_path: Path, explicit_format: str | None = None\n) -> str\n Detect the output format from a file extension or explicit format string.
Parameters:
Name Type Description Defaultoutput_path Path Path to the output file.
requiredexplicit_format str | None Explicitly specified format, if any.
None Returns:
Type Descriptionstr The detected format string.
Raises:
Type DescriptionValueError If the format cannot be determined.
Source code inmt5cli/cli.py def detect_format(\n output_path: Path,\n explicit_format: str | None = None,\n) -> str:\n \"\"\"Detect the output format from a file extension or explicit format string.\n\n Args:\n output_path: Path to the output file.\n explicit_format: Explicitly specified format, if any.\n\n Returns:\n The detected format string.\n\n Raises:\n ValueError: If the format cannot be determined.\n \"\"\"\n if explicit_format is not None:\n return explicit_format\n suffix = output_path.suffix.lower()\n if suffix in _FORMAT_EXTENSIONS:\n return _FORMAT_EXTENSIONS[suffix]\n msg = (\n f\"Cannot detect format from extension '{suffix}'.\"\n \" Use --format to specify the output format.\"\n )\n raise ValueError(msg)\n"},{"location":"api/cli/#mt5cli.cli.export_dataframe","title":"export_dataframe","text":"export_dataframe(\n df: DataFrame,\n output_path: Path,\n output_format: str,\n table_name: str = \"data\",\n) -> None\n Export a pandas DataFrame to the specified file format.
Parameters:
Name Type Description Defaultdf DataFrame DataFrame to export.
requiredoutput_path Path Path to the output file.
requiredoutput_format str Output format (csv, json, parquet, or sqlite3).
requiredtable_name str Table name for SQLite3 output.
'data' Raises:
Type DescriptionValueError If the output format is not supported.
Source code inmt5cli/cli.py def export_dataframe(\n df: pd.DataFrame,\n output_path: Path,\n output_format: str,\n table_name: str = \"data\",\n) -> None:\n \"\"\"Export a pandas DataFrame to the specified file format.\n\n Args:\n df: DataFrame to export.\n output_path: Path to the output file.\n output_format: Output format (csv, json, parquet, or sqlite3).\n table_name: Table name for SQLite3 output.\n\n Raises:\n ValueError: If the output format is not supported.\n \"\"\"\n if output_format == \"csv\":\n df.to_csv(output_path, index=False)\n elif output_format == \"json\":\n df.to_json(\n output_path,\n orient=\"records\",\n date_format=\"iso\",\n indent=2,\n )\n elif output_format == \"parquet\":\n df.to_parquet(output_path, index=False)\n elif output_format == \"sqlite3\":\n with sqlite3.connect(output_path) as conn:\n df.to_sql( # type: ignore[reportUnknownMemberType]\n table_name,\n conn,\n if_exists=\"replace\",\n index=False,\n )\n else:\n msg = f\"Unsupported output format: {output_format}\"\n raise ValueError(msg)\n"},{"location":"api/cli/#mt5cli.cli.history_deals","title":"history_deals","text":"history_deals(\n ctx: Context,\n date_from: Annotated[\n datetime | None,\n Option(\n click_type=DATETIME_TYPE, help=\"Start date.\"\n ),\n ] = None,\n date_to: Annotated[\n datetime | None,\n Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ] = None,\n group: Annotated[\n str | None, Option(help=\"Group filter.\")\n ] = None,\n symbol: Annotated[\n str | None, Option(help=\"Symbol filter.\")\n ] = None,\n ticket: Annotated[\n int | None, Option(help=\"Order ticket.\")\n ] = None,\n position: Annotated[\n int | None, Option(help=\"Position ticket.\")\n ] = None,\n) -> None\n Export historical deals.
Source code inmt5cli/cli.py @app.command()\ndef history_deals(\n ctx: typer.Context,\n date_from: Annotated[\n datetime | None,\n typer.Option(click_type=DATETIME_TYPE, help=\"Start date.\"),\n ] = None,\n date_to: Annotated[\n datetime | None,\n typer.Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ] = None,\n group: Annotated[str | None, typer.Option(help=\"Group filter.\")] = None,\n symbol: Annotated[str | None, typer.Option(help=\"Symbol filter.\")] = None,\n ticket: Annotated[int | None, typer.Option(help=\"Order ticket.\")] = None,\n position: Annotated[int | None, typer.Option(help=\"Position ticket.\")] = None,\n) -> None:\n \"\"\"Export historical deals.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.history_deals_get_as_df(\n date_from=date_from,\n date_to=date_to,\n group=group,\n symbol=symbol,\n ticket=ticket,\n position=position,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.history_orders","title":"history_orders","text":"history_orders(\n ctx: Context,\n date_from: Annotated[\n datetime | None,\n Option(\n click_type=DATETIME_TYPE, help=\"Start date.\"\n ),\n ] = None,\n date_to: Annotated[\n datetime | None,\n Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ] = None,\n group: Annotated[\n str | None, Option(help=\"Group filter.\")\n ] = None,\n symbol: Annotated[\n str | None, Option(help=\"Symbol filter.\")\n ] = None,\n ticket: Annotated[\n int | None, Option(help=\"Order ticket.\")\n ] = None,\n position: Annotated[\n int | None, Option(help=\"Position ticket.\")\n ] = None,\n) -> None\n Export historical orders.
Source code inmt5cli/cli.py @app.command()\ndef history_orders(\n ctx: typer.Context,\n date_from: Annotated[\n datetime | None,\n typer.Option(click_type=DATETIME_TYPE, help=\"Start date.\"),\n ] = None,\n date_to: Annotated[\n datetime | None,\n typer.Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ] = None,\n group: Annotated[str | None, typer.Option(help=\"Group filter.\")] = None,\n symbol: Annotated[str | None, typer.Option(help=\"Symbol filter.\")] = None,\n ticket: Annotated[int | None, typer.Option(help=\"Order ticket.\")] = None,\n position: Annotated[int | None, typer.Option(help=\"Position ticket.\")] = None,\n) -> None:\n \"\"\"Export historical orders.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.history_orders_get_as_df(\n date_from=date_from,\n date_to=date_to,\n group=group,\n symbol=symbol,\n ticket=ticket,\n position=position,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.main","title":"main","text":"main() -> None\n Run the mt5cli CLI.
Source code inmt5cli/cli.py def main() -> None:\n \"\"\"Run the mt5cli CLI.\"\"\"\n app()\n"},{"location":"api/cli/#mt5cli.cli.orders","title":"orders","text":"orders(\n ctx: Context,\n symbol: Annotated[\n str | None, Option(help=\"Symbol filter.\")\n ] = None,\n group: Annotated[\n str | None, Option(help=\"Group filter.\")\n ] = None,\n ticket: Annotated[\n int | None, Option(help=\"Ticket filter.\")\n ] = None,\n) -> None\n Export active orders.
Source code inmt5cli/cli.py @app.command()\ndef orders(\n ctx: typer.Context,\n symbol: Annotated[str | None, typer.Option(help=\"Symbol filter.\")] = None,\n group: Annotated[str | None, typer.Option(help=\"Group filter.\")] = None,\n ticket: Annotated[int | None, typer.Option(help=\"Ticket filter.\")] = None,\n) -> None:\n \"\"\"Export active orders.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.orders_get_as_df(\n symbol=symbol,\n group=group,\n ticket=ticket,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.parse_datetime","title":"parse_datetime","text":"parse_datetime(value: str) -> datetime\n Parse an ISO 8601 datetime string to a timezone-aware datetime.
Parameters:
Name Type Description Defaultvalue str ISO 8601 datetime string (e.g., '2024-01-01' or '2024-01-01T12:00:00+00:00').
requiredReturns:
Type Descriptiondatetime Parsed datetime with UTC timezone if no timezone is specified.
Raises:
Type DescriptionValueError If the string cannot be parsed.
Source code inmt5cli/cli.py def parse_datetime(value: str) -> datetime:\n \"\"\"Parse an ISO 8601 datetime string to a timezone-aware datetime.\n\n Args:\n value: ISO 8601 datetime string (e.g., '2024-01-01' or\n '2024-01-01T12:00:00+00:00').\n\n Returns:\n Parsed datetime with UTC timezone if no timezone is specified.\n\n Raises:\n ValueError: If the string cannot be parsed.\n \"\"\"\n try:\n dt = datetime.fromisoformat(value)\n except ValueError:\n msg = f\"Invalid datetime format: '{value}'. Use ISO 8601 format.\"\n raise ValueError(msg) from None\n if dt.tzinfo is None:\n dt = dt.replace(tzinfo=UTC)\n return dt\n"},{"location":"api/cli/#mt5cli.cli.parse_tick_flags","title":"parse_tick_flags","text":"parse_tick_flags(value: str) -> int\n Parse tick flags string or integer value.
Parameters:
Name Type Description Defaultvalue str Tick flag name (ALL, INFO, TRADE) or integer value.
requiredReturns:
Type Descriptionint Integer tick flag value.
Raises:
Type DescriptionValueError If the flag is invalid.
Source code inmt5cli/cli.py def parse_tick_flags(value: str) -> int:\n \"\"\"Parse tick flags string or integer value.\n\n Args:\n value: Tick flag name (ALL, INFO, TRADE) or integer value.\n\n Returns:\n Integer tick flag value.\n\n Raises:\n ValueError: If the flag is invalid.\n \"\"\"\n upper = value.upper()\n if upper in TICK_FLAG_MAP:\n return TICK_FLAG_MAP[upper]\n try:\n return int(value)\n except ValueError:\n valid = \", \".join(TICK_FLAG_MAP)\n msg = f\"Invalid tick flags: '{value}'. Use one of: {valid}, or an integer.\"\n raise ValueError(msg) from None\n"},{"location":"api/cli/#mt5cli.cli.parse_timeframe","title":"parse_timeframe","text":"parse_timeframe(value: str) -> int\n Parse a timeframe string or integer value.
Parameters:
Name Type Description Defaultvalue str Timeframe name (e.g., 'M1', 'H1', 'D1') or integer value.
requiredReturns:
Type Descriptionint Integer timeframe value.
Raises:
Type DescriptionValueError If the timeframe is invalid.
Source code inmt5cli/cli.py def parse_timeframe(value: str) -> int:\n \"\"\"Parse a timeframe string or integer value.\n\n Args:\n value: Timeframe name (e.g., 'M1', 'H1', 'D1') or integer value.\n\n Returns:\n Integer timeframe value.\n\n Raises:\n ValueError: If the timeframe is invalid.\n \"\"\"\n upper = value.upper()\n if upper in TIMEFRAME_MAP:\n return TIMEFRAME_MAP[upper]\n try:\n return int(value)\n except ValueError:\n valid = \", \".join(TIMEFRAME_MAP)\n msg = f\"Invalid timeframe: '{value}'. Use one of: {valid}, or an integer.\"\n raise ValueError(msg) from None\n"},{"location":"api/cli/#mt5cli.cli.positions","title":"positions","text":"positions(\n ctx: Context,\n symbol: Annotated[\n str | None, Option(help=\"Symbol filter.\")\n ] = None,\n group: Annotated[\n str | None, Option(help=\"Group filter.\")\n ] = None,\n ticket: Annotated[\n int | None, Option(help=\"Ticket filter.\")\n ] = None,\n) -> None\n Export open positions.
Source code inmt5cli/cli.py @app.command()\ndef positions(\n ctx: typer.Context,\n symbol: Annotated[str | None, typer.Option(help=\"Symbol filter.\")] = None,\n group: Annotated[str | None, typer.Option(help=\"Group filter.\")] = None,\n ticket: Annotated[int | None, typer.Option(help=\"Ticket filter.\")] = None,\n) -> None:\n \"\"\"Export open positions.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.positions_get_as_df(\n symbol=symbol,\n group=group,\n ticket=ticket,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.rates_from","title":"rates_from","text":"rates_from(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n Option(\n click_type=TIMEFRAME_TYPE,\n help=\"Timeframe (e.g., M1, H1, D1, or integer).\",\n ),\n ],\n date_from: Annotated[\n datetime,\n Option(\n click_type=DATETIME_TYPE,\n help=\"Start date in ISO 8601 format.\",\n ),\n ],\n count: Annotated[\n int, Option(help=\"Number of records.\")\n ],\n) -> None\n Export rates from a start date.
Source code inmt5cli/cli.py @app.command()\ndef rates_from(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n typer.Option(\n click_type=TIMEFRAME_TYPE,\n help=\"Timeframe (e.g., M1, H1, D1, or integer).\",\n ),\n ],\n date_from: Annotated[\n datetime,\n typer.Option(\n click_type=DATETIME_TYPE,\n help=\"Start date in ISO 8601 format.\",\n ),\n ],\n count: Annotated[int, typer.Option(help=\"Number of records.\")],\n) -> None:\n \"\"\"Export rates from a start date.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.copy_rates_from_as_df(\n symbol=symbol,\n timeframe=timeframe,\n date_from=date_from,\n count=count,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.rates_from_pos","title":"rates_from_pos","text":"rates_from_pos(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n Option(\n click_type=TIMEFRAME_TYPE, help=\"Timeframe.\"\n ),\n ],\n start_pos: Annotated[\n int,\n Option(help=\"Start position (0 = current bar).\"),\n ],\n count: Annotated[\n int, Option(help=\"Number of records.\")\n ],\n) -> None\n Export rates from a start position.
Source code inmt5cli/cli.py @app.command()\ndef rates_from_pos(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n typer.Option(\n click_type=TIMEFRAME_TYPE,\n help=\"Timeframe.\",\n ),\n ],\n start_pos: Annotated[int, typer.Option(help=\"Start position (0 = current bar).\")],\n count: Annotated[int, typer.Option(help=\"Number of records.\")],\n) -> None:\n \"\"\"Export rates from a start position.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.copy_rates_from_pos_as_df(\n symbol=symbol,\n timeframe=timeframe,\n start_pos=start_pos,\n count=count,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.rates_range","title":"rates_range","text":"rates_range(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n Option(\n click_type=TIMEFRAME_TYPE, help=\"Timeframe.\"\n ),\n ],\n date_from: Annotated[\n datetime,\n Option(\n click_type=DATETIME_TYPE, help=\"Start date.\"\n ),\n ],\n date_to: Annotated[\n datetime,\n Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ],\n) -> None\n Export rates for a date range.
Source code inmt5cli/cli.py @app.command()\ndef rates_range(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n timeframe: Annotated[\n int,\n typer.Option(\n click_type=TIMEFRAME_TYPE,\n help=\"Timeframe.\",\n ),\n ],\n date_from: Annotated[\n datetime,\n typer.Option(click_type=DATETIME_TYPE, help=\"Start date.\"),\n ],\n date_to: Annotated[\n datetime,\n typer.Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ],\n) -> None:\n \"\"\"Export rates for a date range.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.copy_rates_range_as_df(\n symbol=symbol,\n timeframe=timeframe,\n date_from=date_from,\n date_to=date_to,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.symbol_info","title":"symbol_info","text":"symbol_info(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n) -> None\n Export symbol details.
Source code inmt5cli/cli.py @app.command()\ndef symbol_info(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n) -> None:\n \"\"\"Export symbol details.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.symbol_info_as_df(symbol=symbol),\n )\n"},{"location":"api/cli/#mt5cli.cli.symbols","title":"symbols","text":"symbols(\n ctx: Context,\n group: Annotated[\n str | None,\n Option(help=\"Symbol group filter (e.g., *USD*).\"),\n ] = None,\n) -> None\n Export symbol list.
Source code inmt5cli/cli.py @app.command()\ndef symbols(\n ctx: typer.Context,\n group: Annotated[\n str | None,\n typer.Option(help=\"Symbol group filter (e.g., *USD*).\"),\n ] = None,\n) -> None:\n \"\"\"Export symbol list.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.symbols_get_as_df(group=group),\n )\n"},{"location":"api/cli/#mt5cli.cli.terminal_info","title":"terminal_info","text":"terminal_info(ctx: Context) -> None\n Export terminal information.
Source code inmt5cli/cli.py @app.command()\ndef terminal_info(ctx: typer.Context) -> None:\n \"\"\"Export terminal information.\"\"\"\n _execute_export(ctx, lambda c: c.terminal_info_as_df())\n"},{"location":"api/cli/#mt5cli.cli.ticks_from","title":"ticks_from","text":"ticks_from(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n date_from: Annotated[\n datetime,\n Option(\n click_type=DATETIME_TYPE, help=\"Start date.\"\n ),\n ],\n count: Annotated[int, Option(help=\"Number of ticks.\")],\n flags: Annotated[\n int,\n Option(\n click_type=TICK_FLAGS_TYPE,\n help=\"Tick flags (ALL, INFO, TRADE, or integer).\",\n ),\n ],\n) -> None\n Export ticks from a start date.
Source code inmt5cli/cli.py @app.command()\ndef ticks_from(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n date_from: Annotated[\n datetime,\n typer.Option(click_type=DATETIME_TYPE, help=\"Start date.\"),\n ],\n count: Annotated[int, typer.Option(help=\"Number of ticks.\")],\n flags: Annotated[\n int,\n typer.Option(\n click_type=TICK_FLAGS_TYPE,\n help=\"Tick flags (ALL, INFO, TRADE, or integer).\",\n ),\n ],\n) -> None:\n \"\"\"Export ticks from a start date.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.copy_ticks_from_as_df(\n symbol=symbol,\n date_from=date_from,\n count=count,\n flags=flags,\n ),\n )\n"},{"location":"api/cli/#mt5cli.cli.ticks_range","title":"ticks_range","text":"ticks_range(\n ctx: Context,\n symbol: Annotated[str, Option(help=\"Symbol name.\")],\n date_from: Annotated[\n datetime,\n Option(\n click_type=DATETIME_TYPE, help=\"Start date.\"\n ),\n ],\n date_to: Annotated[\n datetime,\n Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ],\n flags: Annotated[\n int,\n Option(\n click_type=TICK_FLAGS_TYPE, help=\"Tick flags.\"\n ),\n ],\n) -> None\n Export ticks for a date range.
Source code inmt5cli/cli.py @app.command()\ndef ticks_range(\n ctx: typer.Context,\n symbol: Annotated[str, typer.Option(help=\"Symbol name.\")],\n date_from: Annotated[\n datetime,\n typer.Option(click_type=DATETIME_TYPE, help=\"Start date.\"),\n ],\n date_to: Annotated[\n datetime,\n typer.Option(click_type=DATETIME_TYPE, help=\"End date.\"),\n ],\n flags: Annotated[\n int,\n typer.Option(click_type=TICK_FLAGS_TYPE, help=\"Tick flags.\"),\n ],\n) -> None:\n \"\"\"Export ticks for a date range.\"\"\"\n _execute_export(\n ctx,\n lambda c: c.copy_ticks_range_as_df(\n symbol=symbol,\n date_from=date_from,\n date_to=date_to,\n flags=flags,\n ),\n )\n"}]}