Get data for the Statistics widget

Use these API methods to retrieve account details and trading statistics for display in the B2COPY Statistics widget

Use the following two methods to get information for display in the Statistics widget for a specific master or investment account:

  • GET [host]/api/v1/investment/widget/detail/{account}

  • GET [host]/api/v1/investment/widget/statistics/{account}

Get details for the widget

GET [host]/api/v1/investment/widget/detail/{account}

This method returns information about the fee plan created for a master account, number of followers, account return, chart data, profile picture, strategy description, and other relevant information. In the widget, the returned information is displayed as follows:

Statistics widget
Statistics widget

Request

Headers

Authorization: Bearer <access_token>

Path parameter

Name
Required
Description

account

Yes

The MT login (number) of an account for which you want to get information.

Query parameter

Name
Required
Description

investment_platform_id

Yes

The identifier of the investment platform instance.

  • If only one MT server is connected to your B2COPY investment platform, specify 1.

  • If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.

Request example

curl --location --request GET 'https://host.name/api/v1/investment/widget/detail/77616894?investment_platform_id=1' \
--header 'Authorization: Bearer <token>'

Response

The response includes the object providing details about the requested account for display in the Statistics widget.

Response example
{
    "status": 200,
    "meta": {
        "behaviours": [],
        "status": 200
    },
    "data": {
        "id": 32065,
        "aum": 25091.19,
        "followers": 4,
        "badge": {
            "activity": 1
        },
        "created": "2024-07-18 08:19:11",
        "currency": "USD",
        "description": "Trading strategy description",
        "fees": {
            "plan_id": 112,
            "performance_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "performance_fee": "10",
            "management_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "management_fee": "2",
            "profit_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "profit_fee": "10",
            "subscription_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "subscription_fee": "1",
            "volume_fee": "1",
            "joining_fee": "1"
        },
        "minichart": {
            "points": [
              {
                "etwr": 0,
                "btwr": 0,
                "balance": 1000,
                "equity": 1000,
                "timestamp": 1721290807
            }
            ],
            "count": 40
        },
        "name": "Account name",
        "requirements": {
            "minDeposit": 0
        },
        "risk": 86,
        "user": {
            "nickname": "Client's nickname",
            "country": ""
        },
        "platform": {
            "id": 21,
            "caption": "MT5 B2COPY",
            "short_caption": "",
            "name": "MT5 B2COPY",
            "class": "MetaTrader5",
            "enabled": true,
            "demo": false,
            "has_multiple_type_password": true
        },
        "account_id": "124214",
        "active_subscriptions_count": 0,
        "balance": "691.56",
        "equity": "13,373.77",
        "trade": 10,
        "children": 4,
        "children_last_week": 2,
        "max_daily_loss": 1756.07,
        "max_daily_profit": 3934.85,
        "max_dd": 86,
        "negative_pl_90_days": 0,
        "negative_pl_all_days": 0,
        "order_last_week": 1,
        "positive_pl_90_days": 0,
        "positive_pl_all_days": 0,
        "profit_12_month": 577,
        "profit_18_month": 577,
        "profit_3_month": 577,
        "profit_6_month": 577,
        "profit_all": 577,
        "profit_factor_90_days": 0,
        "profit_factor_all_days": 0,
        "profit_month": 26,
        "profit_week": 142,
        "realized_pl": -1308.44,
        "score": 49,
        "symbol": "USD",
        "subscribersIds": [
            143220,
            146565,
            124217,
            124218
        ],
        "minimum_deposit": 0,
        "has_subscription_code": false,
        "has_promo_offer": false,
        "show_in_leaderbord": true,
        "subscriptionInvestorAccounts": [
            143220,
            146565,
            124217,
            124218
        ],
        "allocation_method": 4,
        "risk_ratio": 1
    },
    "modules": []
}

Get statistics for the widget

GET [host]/api/v1/investment/widget/statistics/{account}

This method returns information about trading instruments used on a master or investment account and the percentage ratios of their use, as well as some trading statistics. In the widget, the returned information is displayed as follows:

Trading Statistics
Trading Statistics

Request

Headers

Authorization: Bearer <access_token>

Path parameter

Name
Required
Description

account

Yes

The MT login (number) of an account for which you want to get information.

Query parameter

Name
Required
Description

investment_platform_id

Yes

The identifier of the investment platform instance.

  • If only one MT server is connected to your B2COPY investment platform, specify 1.

  • If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.

Request example

curl --location --request GET 'https://host.name/api/v1/investment/widget/statistics/77616894?investment_platform_id=1' \
--header 'Authorization: Bearer <token>'

Response

The response includes the object providing information about trading instruments used on the requested account for display in the Statistics widget.

Response example
{
    "status": 200,
    "meta": {
        "behaviours": [],
        "status": 200
    },
    "data": {
        "instruments_ratios": [
            {
                "name": "GBPUSD",
                "ratio": 27
            },
            {
                "name": "USDJPY",
                "ratio": 27
            },
            {
                "name": "USDCHF",
                "ratio": 9
            },
            {
                "name": "EURUSD",
                "ratio": 37
            }
        ],
        "number_of_trades": 11,
        "total_instruments": 4,
        "winning_trades": 3,
        "losing_trades": 8,
        "buy_trades": 5,
        "sell_trades": 6,
        "winning_weeks": 2,
        "losing_weeks": 1,
        "avg_trade_time": "0.14",
        "avg_trades_per_week": "5.5",
        "consecutive_losses": 3,
        "consecutive_wins": 1
    },
    "modules": []
}

See also:

Configure B2COPY widgets

Last updated

Was this helpful?