Download the PHP package oyi77/metaapi-cloud-php-sdk without Composer

On this page you can find all versions of the php package oyi77/metaapi-cloud-php-sdk. 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 metaapi-cloud-php-sdk

Metaapi PHP SDK

A PHP Package that let you seamlessly perform API calls to MetaApi https://metaapi.cloud/

This SDK provides access to:

Installation

To install the SDK in your project you need to install the package via composer:

Usage

MetaApi Websocket (RPC & Real-time streaming)

This SDK now includes a minimal Socket.IO-based websocket client for MetaApi RPC API and MetaApi real-time streaming API (see the guideline docs in guideline/ and the official websocket docs on metaapi.cloud).

RPC Connection (Request/Response)

Streaming Connection (Continuous Synchronization)

Examples

For complete working examples, see the examples/ directory:

MetaApi Examples:

CopyFactory Examples:

Risk Management Examples:

Account Management

You can create an instance of the SDK like so for Account Management:

All methods throws exceptions when the request is not successful, so be sure to put your code in a try and catch block.

You can add a trading account and starts a cloud API server for the trading account like so:

if the request was successful , you will get the the account id and state, else an Exception will be thrown

You can read an account by the id

You can read all trading accounts in your metaapi account

You can update an account

Undeploy an account

Deploy an account

Redeploy an account

Delete an account

Create configuration link for end-user account setup

CopyFactory

You can create an instance of the SDK like so for Copyfactory:

To generate a strategy id

To get all your strategies

To get a single strategy

To update a strategy

To remove a strategy

To get all your subscribers

To get a subscriber

To update a subscriber data

To remove a subscriber

To delete a subscription

Webhooks

CopyFactory supports webhooks for receiving trading signals.

Create a webhook

Update a webhook

Get webhooks

Delete a webhook

Copy Trade

To Copy a trade from provider to subscriber. I recommend you create a strategy before hand and save to your database before you perform a copy trade, but its not compulsory as the package will create one for you. You can always read all your strategies in your account with the " $copyfactory->strategies()".

To Copy trade do:

Note: copying a trade will take some seconds to finish, you you can have a loading indicator as feedback.

MetaStats

You can get metrics for you account

You can create an instance of the SDK like so for MetaStats:

To get metrics:

To get open trades for MetaApi account:

To get account trades for a time range:

Provisioning Profile API

Provisioning profiles can be used as an alternative way to create MetaTrader accounts if automatic broker settings detection has failed.

Create a provisioning profile

Get provisioning profiles

Get, update, and delete provisioning profile

Token Management API

Generate narrowed-down tokens for use in Web or Mobile applications.

Narrow down token to specific applications

Narrow down token to specific roles

Narrow down token to specific resources

Narrow down token with combined restrictions

Get access rules manifest

Risk Management API

Risk Management API for executing trading challenges and competitions.

Create and manage trackers

Get tracker events and statistics

Expert Advisor Management

Manage custom expert advisors (EAs) for MT4 accounts on G1 infrastructure. Note: EAs using DLLs are not supported.

Create an expert advisor

Get expert advisors

Update and delete expert advisor

Historical Data API

Retrieve historical market data (candles and ticks). Available on G1 and MT4 G2 instances only.

Get historical candles

Get historical ticks

Demo Account Generator API

Create MT4 and MT5 demo accounts. Note: Not all MT4/MT5 servers allow creating demo accounts using this method.

Create MT4 demo account

Create MT5 demo account

Manager API

Access and manage MT4 and MT5 servers. For detailed endpoint documentation, see: https://metaapi.cloud/docs/manager/

The Manager API provides generic methods for accessing MT Manager endpoints:

Latency Monitor

Track API latencies for monitoring and optimization.

Logging Support

Enable logging for debugging and monitoring. Supports PSR-3 compatible loggers and file logging.

Pagination Helper

The SDK includes a pagination helper utility for working with paginated responses:

Testing

API Reference

All API references can be found on Metaapi documentation website. https://metaapi.cloud/

Security

If you discover any security related issues, please open an issue.

Contributing

Pull requests are welcome.

How can I thank you?

Why not star the github repo? I'd love the attention! you can share the link for this repository on Twitter or HackerNews?

Don't forget to follow me on twitter!

Thanks! Efekpogua Victory.

About This Repository

So here's the story - I was working on a project that needed to integrate with MetaApi, and I found this PHP SDK that looked promising. Turned out it was created by Efekpogua Victory a couple years back, and it worked fine for basic stuff. But when I dug deeper, I realized it was missing a bunch of features that the Python SDK already had.

The original SDK hadn't been touched in like 2 years, and I really needed those missing APIs. Instead of starting from scratch (which would've been a pain), I decided to fork it and bring it up to speed. I spent some time going through the Python SDK docs and examples, figuring out what was missing, then added all the REST API stuff that should've been there.

Now I'm maintaining this actively, so if you find bugs or need something added, just open an issue. I'll get to it faster than the previous maintainer did (no offense to the original author - we all get busy).

Credits

Big shoutout to Efekpogua Victory for building the initial version of this SDK. He did the hard work of setting up the foundation, and without that, I'd still be writing HTTP wrappers from scratch. So thanks for that!

I (Oyi77) forked it and updated everything to match what the Python SDK can do. The goal is to keep this thing maintained and useful for anyone who needs a PHP SDK for MetaApi.

License

The MIT License (MIT). Please see License File or more information.


All versions of metaapi-cloud-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2
guzzlehttp/guzzle Version ^7.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 oyi77/metaapi-cloud-php-sdk contains the following files

Loading the files please wait ...