PHPackages                             tarikhagustia/laravel-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. tarikhagustia/laravel-mt5

ActiveLibrary[API Development](/categories/api)

tarikhagustia/laravel-mt5
=========================

Metatrader 5 Web API Wrapper for Laravel

1.4.1(4y ago)3194530[2 issues](https://github.com/tarikhagustia/laravel-mt5/issues)MITPHP

Since Nov 6Pushed 4y ago7 watchersCompare

[ Source](https://github.com/tarikhagustia/laravel-mt5)[ Packagist](https://packagist.org/packages/tarikhagustia/laravel-mt5)[ RSS](/packages/tarikhagustia-laravel-mt5/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Laravel MT5
-----------

[](#laravel-mt5)

This is Laravel 6.x package wrapper library for Metatrader 5 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 tarikhagustia/laravel-mt5

```

### Configure

[](#configure)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
Tarikhagustia\LaravelMt5\LaravelMt5Provider::class,

```

#### Copy the package config to your local config with the publish command:

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

```
php artisan vendor:publish --provider="Tarikhagustia\LaravelMt5\LaravelMt5Provider"
```

and then you can configure connection information to MT5 with this `.env` value

```
MT5_SERVER_IP=
MT5_SERVER_PORT=
MT5_SERVER_WEB_LOGIN=
MT5_SERVER_WEB_PASSWORD=
```

Usage
-----

[](#usage)

### Create Deposit

[](#create-deposit)

```
use Tarikhagustia\LaravelMt5\Entities\Trade;
use Tarikhagustia\LaravelMt5\LaravelMt5;

$api = new LaravelMt5();
$trade = new Trade();
$trade->setLogin(6000189);
$trade->setAmount(100);
$trade->setComment("Deposit");
$trade->setType(Trade::DEAL_BALANCE);
$result = $api->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 Tarikhagustia\LaravelMt5\Entities\User;
use Tarikhagustia\LaravelMt5\LaravelMt5;

$api = new LaravelMt5();
$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 = $api->createUser($user);
```

### Get Trading Account Information

[](#get-trading-account-information)

```
use Tarikhagustia\LaravelMt5\LaravelMt5;

$api = new LaravelMt5();
$user = $api->getTradingAccounts($login);

$balance = $user->Balance;
$equity = $user->Equity;
$freeMargin = $user->MarginFree;
```

### Get Trading History By Login Number

[](#get-trading-history-by-login-number)

```
use Tarikhagustia\LaravelMt5\LaravelMt5;

$api = new LaravelMt5();
// Get Closed Order Total and pagination
$total = $api->getOrderHistoryTotal($exampleLogin, $timestampfrom, $timestampto);
$trades = $api->getOrderHistoryPagination($exampleLogin, $timestampfrom, $timestampto, 0, $total);
foreach ($trades as $trade) {
    // see class MTOrder
    echo "LOGIN : ".$trade->Login.PHP_EOL;
    echo "TICKET : ".$trade->Order.PHP_EOL;
}
```

### Open Order

[](#open-order)

```
use Tarikhagustia\LaravelMt5\LaravelMt5;
$api = new LaravelMt5();
$api->dealerSend([
    'Login' => 8113,
    'Symbol' => 'XAUUSD',
    'Volume' => 100,
    'Type' => 0
});
```

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

### Todo

[](#todo)

- Deposit or Withdrawal
- Create Account
- Open Order
- Get Trading Account Information
- Change Password
- Create Group
- Delete Group
- 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

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~108 days

Total

7

Last Release

1735d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29f92255bc4da7c184fa810e879165c2d08c03609136ea8f2f4172c359fdf2d6?d=identicon)[tarikhagustia](/maintainers/tarikhagustia)

---

Top Contributors

[![tarikhagustia](https://avatars.githubusercontent.com/u/17002233?v=4)](https://github.com/tarikhagustia "tarikhagustia (12 commits)")

---

Tags

metatrader5mt5mt5webapi

### Embed Badge

![Health badge](/badges/tarikhagustia-laravel-mt5/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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