1. Go to this page and download the library: Download julioortahdz/php-mt5 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
julioortahdz / php-mt5 example snippets
use JulioOrtaHdz\PhpMeta\Entities\Trade;
use JulioOrtaHdz\PhpMeta\LaravelMt5;
use JulioOrtaHdz\PhpMeta\MetaTraderClient;
use JulioOrtaHdz\PhpMeta\Entities\User;
use JulioOrtaHdz\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 = $api->trade($trade);