Skip to content

Latest commit

 

History

History
224 lines (161 loc) · 6.83 KB

File metadata and controls

224 lines (161 loc) · 6.83 KB

D4T\MT5Sdk\TradeApi

All URIs are relative to /v1

Method HTTP request Description
closeAllUserLoginDelete DELETE /close_all/{user_login} Close all positions
dealsUserLoginGet GET /deals/{user_login} Get list of user deals
ordersUserLoginGet GET /orders/{user_login} Get list of user orders
positionsUserLoginGet GET /positions/{user_login} Get list of user positions

closeAllUserLoginDelete

closeAllUserLoginDelete($user_login)

Close all positions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearerAuth
    $config = D4T\MT5Sdk\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new D4T\MT5Sdk\MT5Manager\TradeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user_login = "user_login_example"; // string | The login that needs to be flattern

try {
    $apiInstance->closeAllUserLoginDelete($user_login);
} catch (Exception $e) {
    echo 'Exception when calling TradeApi->closeAllUserLoginDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
user_login string The login that needs to be flattern

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

dealsUserLoginGet

\D4T\MT5Sdk\Models\Deal[] dealsUserLoginGet($user_login, $days_back)

Get list of user deals

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearerAuth
    $config = D4T\MT5Sdk\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new D4T\MT5Sdk\MT5Manager\TradeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user_login = "user_login_example"; // string | The name that needs to be fetched for.
$days_back = "days_back_example"; // string | Days Back

try {
    $result = $apiInstance->dealsUserLoginGet($user_login, $days_back);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TradeApi->dealsUserLoginGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
user_login string The name that needs to be fetched for.
days_back string Days Back

Return type

\D4T\MT5Sdk\Models\Deal[]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ordersUserLoginGet

\D4T\MT5Sdk\Models\Order[] ordersUserLoginGet($user_login, $days_back, $types)

Get list of user orders

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearerAuth
    $config = D4T\MT5Sdk\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new D4T\MT5Sdk\MT5Manager\TradeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user_login = "user_login_example"; // string | The name that needs to be fetched for.
$days_back = "days_back_example"; // string | Days Back
$types = "types_example"; // string | Types

try {
    $result = $apiInstance->ordersUserLoginGet($user_login, $days_back, $types);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TradeApi->ordersUserLoginGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
user_login string The name that needs to be fetched for.
days_back string Days Back
types string Types

Return type

\D4T\MT5Sdk\Models\Order[]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

positionsUserLoginGet

\D4T\MT5Sdk\Models\Position[] positionsUserLoginGet($user_login)

Get list of user positions

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearerAuth
    $config = D4T\MT5Sdk\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new D4T\MT5Sdk\MT5Manager\TradeApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user_login = "user_login_example"; // string | The name that needs to be fetched for.

try {
    $result = $apiInstance->positionsUserLoginGet($user_login);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TradeApi->positionsUserLoginGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
user_login string The name that needs to be fetched for.

Return type

\D4T\MT5Sdk\Models\Position[]

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]