Download the PHP package aleedhillon/meta-trader-client without Composer

On this page you can find all versions of the php package aleedhillon/meta-trader-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package meta-trader-client

MetaTrader Client for Laravel

Latest Version on Packagist Total Downloads License: MIT

A powerful Laravel package for seamless integration with the MetaTrader 5 Web API. This package enables brokers and financial applications to connect with MT5 servers and perform various operations including account management, trading operations, and market data retrieval.

โœจ Modernized for PHP 8.4 - Features modern PHP syntax, proper exception handling, type safety, and clean API design.

๐Ÿ“‹ Features

๐Ÿš€ Installation

You can install the package via composer:

The package will automatically register its service provider and facade.

โš™๏ธ Configuration

Publish the configuration file:

This will create a config/meta-trader-client.php file with the following content:

Add the following environment variables to your .env file:

๐ŸŽฏ Exception Handling

The modernized client uses a comprehensive exception system instead of return codes. All exceptions extend MetaTraderException:

Exception Types

๐Ÿ“– Usage

Basic Connection

The client now features automatic connection management - you don't need to manually connect/disconnect:

User Management

All user management methods now return objects directly and throw exceptions on errors:

Trading Operations

Trading operations now return objects directly with full type safety:

Market Data

Market data operations with modern return types:

Group Management

Group management with modern API design:

Symbol Management

Symbol configuration with type-safe operations:

Communication

Send notifications with error handling:

Server Management

Server operations with modern exception handling:

Custom Commands

Execute custom commands with structured responses:

Utility Methods

The client provides many static utility methods for working with MT5 data:

๐Ÿงช Development & Testing

Using Workbench

This package includes a Workbench environment for development and testing. The workbench provides a complete Laravel application environment to test the package functionality.

Setup Workbench

  1. Copy the environment file:

  2. Configure your MT5 server details in workbench/.env:

  3. Test the connection:

Available Commands

The workbench command provides a comprehensive test of your MT5 connection including:

Package Information

View package information using Laravel's built-in about command:

This will display MetaTrader Client information including version, WebAPI details, and Laravel compatibility.

Advanced Publishing Options

For more specific publishing needs, you can also use:

Note: The --provider flag publishes all publishable files defined by the package's service provider, giving you access to all available resources in one command.

Artisan Commands

The package includes comprehensive Artisan commands to help you manage and monitor your MT5 integration:

mt5 - Package Information & Configuration

Display package configuration and basic information without making any API calls.

What it shows:

mt5:status - Server Status Report

Display server status, connection information, and statistics.

What it shows:

mt5:groups - Display All Trading Groups

Show all trading groups with progress indicator.

What it shows:

mt5:symbols - Display All Trading Symbols

Show all trading symbols with progress indicator.

What it shows:

Example Outputs:

mt5 Command Example:
mt5:status Command Example:
mt5:groups Command Example:
mt5:symbols Command Example:

General Laravel Commands

๐Ÿ”ง Advanced Usage

Error Code to Exception Mapping

The client automatically maps MT5 error codes to specific exception types:

Direct Instantiation

For advanced use cases, instantiate the client directly:

Configuration Options

Option Environment Variable Default Description
agent MT5_AGENT WebAPI User agent string for API requests
should_crypt MT5_SHOULD_CRYPT true Enable/disable connection encryption
ip MT5_SERVER_IP null MT5 server IP address
port MT5_SERVER_PORT 443 MT5 server port
login MT5_SERVER_WEB_LOGIN null Web API login
password MT5_SERVER_WEB_PASSWORD null Web API password
timeout MT5_SERVER_TIMEOUT 30 Connection timeout in seconds

๐Ÿ“š Complete API Reference

Connection Management

connect() - Manual Connection

Note: Connection is handled automatically, manual connection is optional.

disconnect() - Manual Disconnection

isConnected() - Check Connection Status

ping() - Test Server Response

Server Information

timeGet() - Get Detailed Time Information

timeServer() - Get Server Timestamp

commonGet() - Get Server Information

serverRestart() - Restart Server (Admin Only)

User Management

userCreate() - Create User Template

userAdd() - Add New User

userGet() - Get User Information

userUpdate() - Update User Information

userDelete() - Delete User

userPasswordCheck() - Verify User Password

userPasswordChange() - Change User Password

userDepositChange() - Change User Balance

userAccountGet() - Get Account Information

userLogins() - Get User Logins by Group

Trading Operations

orderGet() - Get Order Information

orderGetTotal() - Get Total Orders Count

orderGetPage() - Get Orders by Page

positionGet() - Get Position Information

positionGetTotal() - Get Total Positions Count

positionGetPage() - Get Positions by Page

dealGet() - Get Deal Information

dealGetTotal() - Get Total Deals Count

dealGetPage() - Get Deals by Page

historyGet() - Get History Order

historyGetTotal() - Get History Count

historyGetPage() - Get History by Page

tradeBalance() - Execute Balance Operation

Market Data

symbolGet() - Get Symbol Information

symbolTotal() - Get Total Symbols Count

symbolNext() - Get Symbol by Position

symbolGetGroup() - Get Symbol by Group

symbolCreate() - Create Symbol Template

symbolAdd() - Add New Symbol

symbolDelete() - Delete Symbol

tickLast() - Get Last Ticks

tickLastGroup() - Get Last Ticks by Group

tickStat() - Get Tick Statistics

Group Management

groupTotal() - Get Total Groups Count

groupNext() - Get Group by Position

groupGet() - Get Group Information

groupCreate() - Create Group Template

groupAdd() - Add New Group

groupDelete() - Delete Group

Communication

mailSend() - Send Email to User

newsSend() - Send News

Custom Commands

customSend() - Send Custom Command

Utility Methods

Error Handling

Volume Conversion

Validation

Data Conversion

Time Utilities

Default Values

Version Information

๐Ÿ” Migration from Legacy Code

If you're upgrading from an older version, here are the key changes:

Before (Legacy)

After (Modern)

๐Ÿ“š API Reference

For a complete list of available methods and their parameters, please refer to the MetaTrader 5 Web API Documentation.

Key Method Changes

๐Ÿ”’ Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

The MIT License (MIT). Please see the License File for more information.

๐Ÿ‘จโ€๐Ÿ’ป Credits


All versions of meta-trader-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aleedhillon/meta-trader-client contains the following files

Loading the files please wait ....