PHPackages                             alisafirzadeh/php-mt5 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. alisafirzadeh/php-mt5

ActiveLibrary[API Development](/categories/api)

alisafirzadeh/php-mt5
=====================

A Metatrader 5 Web API Wrapper for Laravel

v1.7.1.1(2y ago)03821MITPHPPHP ^8.0

Since Nov 15Pushed 2y agoCompare

[ Source](https://github.com/Alisafirzadeh/php-mt5)[ Packagist](https://packagist.org/packages/alisafirzadeh/php-mt5)[ RSS](/packages/alisafirzadeh-php-mt5/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

PHP MT5
-------

[](#php-mt5)

This is PHP Package for MT5 Web API

- [Official MT5 Web Api Documentation](https://support.metaquotes.net/en/docs/mt5/api/webapi).

Documentation
-------------

[](#documentation)

### Installing

[](#installing)

To install the package, in terminal:

```
composer require alisafirzadeh/php-mt5

```

Usage
-----

[](#usage)

### Create Deposit

[](#create-deposit)

```
use Tarikh\PhpMeta\Entities\Trade;
use Tarikh\PhpMeta\LaravelMt5;

use Tarikh\PhpMeta\MetaTraderClient;
use Tarikh\PhpMeta\Entities\User;
use Tarikh\PhpMeta\src\Lib\MTEnDealAction;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);
$trade = new Trade();
$trade->setLogin(6000189);
$trade->setAmount(100);
$trade->setComment("Deposit");
$trade->setType(Trade::DEAL_BALANCE);
$result = $client->trade($trade);
```

The result variable will return Trade class with ticket information, you can grab ticket number by calling `$result->getTicket()`

### Create User

[](#create-user)

```
use Tarikh\PhpMeta\MetaTraderClient;
use Tarikh\PhpMeta\Entities\User;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);
$user = new User();
$user->setName("John Due");
$user->setEmail("john@due.com");
$user->setGroup("demo\demoforex");
$user->setLeverage("50");
$user->setPhone("0856123456");
$user->setAddress("Sukabumi");
$user->setCity("Sukabumi");
$user->setState("Jawa Barat");
$user->setCountry("Indonesia");
$user->setZipCode(1470);
$user->setMainPassword("Secure123");
$user->setInvestorPassword("NotSecure123");
$user->setPhonePassword("NotSecure123");

$result = $client->createUser($user);
```

The result variable will return User class with login information, you can grab login number by calling `$result->getLogin()`

### Change Client Password

[](#change-client-password)

```
use Tarikh\PhpMeta\MetaTraderClient;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);
// $type = "MAIN"; // Change $type to INVESTOR if you want to change investor password
$client->changePasswordUser($exampleLogin, 'SecurePassword', $type);
```

### Get Order By Ticket ID

[](#get-order-by-ticket-id)

```
use Tarikh\PhpMeta\MetaTraderClient;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);
$order = $client->getOrder($ticket = 100);
```

### Get User Information

[](#get-user-information)

```
use Tarikh\PhpMeta\MetaTraderClient;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);
$user = $client->getUser($exampleLogin);
var_dump($user);
```

### Get Last Tick (Price)

[](#get-last-tick-price)

```
use Tarikh\PhpMeta\MetaTraderClient;

$server = "SERVER_MT4_IP";
$port = 443;
$login = "MANAGER LOGIN";
$password = "API PASSWORD";
$exampleLogin = 21001480007;

$client = new MetaTraderClient($server, $port, $login, $password);

// symbol — comma separated symbols, the prices of which should be received. The value length must not exceed 4096 characters. You may use the mask "*" and the negation sign "!" to specify groups of symbols. Example.
// symbol=EURUSD,USDJPY — get quotes for symbols EURUSD and USDJPY.
// symbol=Forex\Major*, GOLD — get quotes of all symbols from the Major subgroup and quotes of GOLD.
// symbol=Forex\Crosses*,!AUDUSD — get quotes of all symbols of the Crosses subgroup except AUDUSD.
// symbol=Forex\Major\EUR* — get quotes of all symbols with the basic currency EUR from the Major subgroup.

$ticks = $client->getLastTick("AUDCAD");
foreach ($ticks as $key => $tick) {
    echo "{$tick->Symbol} BID {$tick->Bid} {$tick->Ask}\n";
}
```

### Todo

[](#todo)

- Deposit or Withdrawal
- Create Account
- Change Password
- Get Order By Ticket ID
- Get User Information
- Get Last Tick (Price)
- Get Accounts
- Remove Account
- Get Trades
- Get Group

Contributing
------------

[](#contributing)

Thank you for considering contributing to the Laravel MT5! you can fork this repository and make pull request.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within Laravel MT5, please send an e-mail to Tarikh Agustia via . All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

The Laravel framework is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

910d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33686f09dbccab1194b9a42e6f7cdaeefdb2f27b8cbc8a5c65d9b72d7f2784d3?d=identicon)[safirzadeh](/maintainers/safirzadeh)

---

Top Contributors

[![Alisafirzadeh](https://avatars.githubusercontent.com/u/54362639?v=4)](https://github.com/Alisafirzadeh "Alisafirzadeh (20 commits)")

### Embed Badge

![Health badge](/badges/alisafirzadeh-php-mt5/health.svg)

```
[![Health](https://phpackages.com/badges/alisafirzadeh-php-mt5/health.svg)](https://phpackages.com/packages/alisafirzadeh-php-mt5)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[echolabsdev/prism

A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.

2.3k388.3k10](/packages/echolabsdev-prism)[sburina/laravel-whmcs-up

WHMCS API client and user provider for Laravel

271.3k](/packages/sburina-laravel-whmcs-up)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
