User specific history

As a user, I should be able to retrieve the history of alerts I have received.

This endpoint returns the list of alerts received using a pagination mechanism to avoid overloading the API.

It can also filter by :

  • date
  • ticker
  • market
  • status

and be sorted by:

  • access date
  • started date
  • closed date
  • ticker
  • market
  • figure time
  • gain
  • status
GET https://api.tradingpartners.ai/api/v1/alerts/history?page=1&size=10&to=2020-01-01T00:00:00Z&from=2020-01-02T00:00:00Z&ticker=BTC&instrument=CRYPTOCURRENCIES&status=WON&orderBy=accessDate&orderDir=ASC

Request Query Parameters


page - number fmt:int Requested page number.

default is 1


size - number fmt:int Size of a page (amount of alerts returned).

default is 10


from - string fmt:date-time All alerts accessed after this from field. In ISO 8601 format.


to - string fmt:date-time
All alerts accessed before this from field. In ISO 8601 format.


ticker - string
Ticker concerned by the alert.
The filtering is case-insensitive & partial match.


instrument - string enum
Markets of the alert
The filtering is case-sensitive & complete match.
  • CRYPTOCURRENCIES
  • FOREX
  • INDICES
  • COMMODITIES
  • FUTURES
  • STOCKS
  • ETFS

status - string enum
Status of the alert
The filtering is case-sensitive & complete match.
  • ONMARK
  • ONGOING
  • WON
  • LOST
  • ABORTED

orderBy - string enum
Order result by field.
  • accessDate
  • startedAt
  • closedAt
  • ticker
  • instrument
  • figureTime
  • gain
  • status

default is accessDate


orderDir - string enum
Order direction.
  • asc
  • desc

default is desc


History response object

Attributes


total - number fmt:int64 Total amount of alerts matching your filter.


page - number fmt:int Current page number.


size - number fmt:int Size of the page.


data - object
List of alerts matching the filter

id - integer fmt:int64
ID of the alert.


ticker - string
Ticker concerned by the alert.


instrument - string enum
Markets of the alert
  • CRYPTOCURRENCIES
  • FOREX
  • INDICES
  • COMMODITIES
  • FUTURES
  • STOCKS
  • ETFS

durationStrategy - string enum
Duration type of the strategy
  • short
  • long

direction - string enum
Direction of the strategy
  • BUY
  • SELL

start - number fmt:float64
Starting price of the alert.


target - number fmt:float64
Price aimed by the alert.


stop - number fmt:float64
StopLoss price of the alert.


startedAt - string fmt:date-time
Date of alert detection.


exit - nullable number fmt:float64
Closing price of the alert.


gain - nullable number fmt:float64
Gain realized by the alert.

Note

A negative gain means that the alert was a losing one.

A positive gain does not mean your credit will be consumed.
It will be only if the gain have reached a certain threshold.


status - nullable string enum
Final status of the alert
  • WON
  • LOST

closedAt - nullable string fmt:date-time
Date of alert closure.

History object

{
	"data": [
		{
		    "id": 1234,
			"accessDate": "2024-01-12T14:44:01Z",
			"durationStrategy": "short",
			"direction": "SELL",
			"instrument": "CRYPTOCURRENCIES",
			"start": 3228.64,
			"startedAt": "2024-01-12T14:44:00Z",
			"stop": 3233.64,
			"target": 3217.4,
			"ticker": "ETH/USD"
		},
		{
		    "id": 1233,
			"accessDate": "2024-01-02T13:34:00Z",
			"closedAt": "2024-01-02T13:33:00Z",
			"exit": 18842,
			"durationStrategy": "long",
			"direction": "BUY",
			"gain": 88,
			"instrument": "FUTURES",
			"start": 18754,
			"startedAt": "2024-01-02T13:24:00Z",
			"status": "WON",
			"stop": 18749,
			"target": 18836,
			"ticker": "FDXM.EUREX.M2024"
		},
		{
            "id": 1232,
			"accessDate": "2024-01-01T00:04:00Z",
			"closedAt": "2024-01-01T00:03:00Z",
			"exit": 69531.6,
			"durationStrategy": "short",
			"direction": "BUY",
			"gain": 529.6,
			"instrument": "CRYPTOCURRENCIES",
			"start": 69002,
			"startedAt": "2024-01-01T00:00:00Z",
			"status": "WON",
			"stop": 68997,
			"target": 69872.4,
			"ticker": "BTC/USD"
		}
	],
	"page": 1,
	"size": 10,
	"total": 3
}