Skip to main content

GET Watermarks

Returns the high-water mark and current PnL statistics for a monitored account. Watermarks track the peak realized and unrealized P/L values during a session and are used by the Account Manager's kill switch logic to determine when thresholds have been breached.

This endpoint is server-side only and does not make an RPC call to the NinjaTrader add-on. The data is read from CrossTrade's session cache, which means it responds instantly and does not require the add-on to be connected at the time of the request.

Retrieve watermark info from Account Management

GET /v1/api/accounts/{account}/watermarks

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Path Parameters

NameTypeRequiredDescription
accountstringRequiredAccount name in NT8

Code Examples

import requests

token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts/Sim101/watermarks"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}

try:
response = requests.get(url, headers=headers)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")

Response

{
"success": true,
"data": {
"account": "Sim101",
"watermarks": {
"pnlhigh": 13.25,
"netliqhigh": 74206.83,
"unrealhigh": 13.25
},
"stats": {
"pnl": -37.33,
"total": -37.33,
"unrealized": -42.68,
"poscount": 2,
"netliq": 74176.25,
"pnlhigh": 13.25,
"netliqhigh": 74206.83,
"unrealhigh": 13.25
}
}
}

info

If the account has no active monitor or no P&L data has been reported for the current session, the watermarks and stats objects will be empty {}

WebSocket API

This request can also be made over the WebSocket API. The account path parameter is passed inside args. Note: this endpoint is handled server-side and does not require the NinjaTrader add-on to be connected.

{
"action": "rpc",
"id": "my-request-id",
"api": "GetWatermarks",
"args": {
"account": "Sim101"
}
}