Skip to content

Get strategy log stream#

About#

Returns event log stream for a CopyFactory strategy. If there are no new records yet, the response will not be sent until a timeout expires or new record arrives. It is recommended to invoke this API in an infinite cycle constantly polling for new records to receive records in real time

GET /users/current/strategies/:strategyId/user-log/stream

For more information see Swagger documentation

Headers#

Name Type Required Description
auth-token string Yes authorization token. See Authentication & authorization

Path parameters#

Name Type Required Description
strategyId string Yes strategy id

Query parameters#

Name Type Required Description
startTime string(datetime) start of time range, inclusive (in ISO format)
limit integer pagination limit, default: 1000, min: 1, max: 1000

Response#

Responses:

  • 200 - Log messages returned successfully. Response schema: Array<UserLogMessage>
  • 401 - Authorization failed. Response schema: Error
  • 404 - Strategy not found. Response schema: Error

Examples#

Example request:

curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://copyfactory-api-v1.new-york.agiliumtrade.ai/users/current/strategies/nIMn/user-log/stream?startTime="2020-04-20T04:00:00.000Z"&limit=50'

Example response:

[
  {
    "time": "2020-08-24T00:00:00.000Z",
    "symbol": "AUDUSD",
    "strategyId": "nIMn",
    "strategyName": "Demo strategy",
    "positionId": "+apNW3",
    "side": "buy",
    "type": "market",
    "openPrice": 1.02371,
    "level": "INFO",
    "message": "Applying the market buy 0.1 EURUSD signal, position id #106493918"
  }
]