Export Violations
API URL: POST https://userapi-demo.s2f.projectx.com/Violations/export
API Reference: /Violations/export
info
Documentation on this page is applicable to platforms that have Account Templates enabled. If you are unsure whether you have Account Templates enabled, please contact your account manager.
Description
Exports violation data.
Account Templates allow organizations to customize their trading accounts. For accounts utilizing these templates, a violation with Violation Type = 6 indicates a rule breach related to both Maximum Loss Limit and Daily Loss Limit violations.
Important: To differentiate between a Daily Loss Limit violation and a Maximum Loss Limit violation, refer to the Get Rule Configuration section.
Parameters
Name | Type | Description | Required | Nullable |
---|---|---|---|---|
startTime | datetime | Start time of the violation data export. | false | false |
endTime | datetime | End time of the violation data export. | false | true |
Example Usage
Example Request
- Request
- cURL
{
"startTime": "2024-11-20T15:19:30.658Z",
"endTime": "2024-11-21T15:19:30.658Z"
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/Violations/export' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"startTime": "2024-11-21T15:19:30.658Z",
"endTime": "2024-11-21T15:19:30.658Z"
}'
Example Response
- Daily Loss Limit
- Maximum Loss Limit
- Personal Daily Loss Limit
- Personal Daily Profit Target
- Error
{
"violations": [
{
"id": 140,
"accountId": 130,
"type": 6, // Violation Type 6 = Rule Break
"duration": 2, // Duration Type 2 = Temporary Violation
"createdAt": "2024-10-23T19:14:29.367645+00:00",
"triggeredAt": "2024-10-23T19:14:29.283301+00:00",
"expiresAt": "2024-10-23T21:50:00+00:00",
"balance": 49879.0000,
"realizedPnl": -121.0000,
"unrealizedPnl": 0,
"violationBalance": 49679.0000,
"violationTotalDayPnl": -321.0000,
"minimumBalance": 0,
"dailyLossLimit": -200.0000,
"personalDailyLossLimit": null,
"personalDailyProfitTarget": null,
"voided": false,
"accountName": "U7A130",
"accountType": 1,
"ruleId": 1, // Rule Id of the Rule Break
"customViolation": null
}
],
"success": true,
"errorMessage": null
}
{
"violations": [
{
"id": 149,
"accountId": 129,
"type": 6, // Violation Type 6 = Rule Break
"duration": 1, // Duration Type 1 = Permanent Violation
"createdAt": "2024-10-30T22:07:35.57101+00:00",
"triggeredAt": "2024-10-30T22:07:35.560082+00:00",
"expiresAt": "2024-10-31T21:50:00+00:00",
"balance": 48870.6000,
"realizedPnl": -1.4000,
"unrealizedPnl": 0,
"violationBalance": 48858.1000,
"violationTotalDayPnl": -13.9000,
"minimumBalance": 50000.0000,
"dailyLossLimit": 1000.0000,
"personalDailyLossLimit": null,
"personalDailyProfitTarget": null,
"voided": false,
"accountName": "U7A129",
"accountType": 1,
"ruleId": 2, // Rule Id of the Rule Break
"customViolation": null
}
],
"success": true,
"errorMessage": null
}
{
"violations": [
{
"id": 123,
"accountId": 120,
"type": 3, // Type 3 is a Personal Daily Loss Limit Violation
"duration": 0,
"createdAt": "2024-10-12T16:21:55.223214+00:00",
"triggeredAt": "2024-10-12T16:21:55.217343+00:00",
"expiresAt": "2024-10-13T21:50:00+00:00",
"balance": 99952.7000,
"realizedPnl": -47.3000,
"unrealizedPnl": 0,
"violationBalance": 99940.2000,
"violationTotalDayPnl": -59.8000,
"minimumBalance": 97000.0000,
"dailyLossLimit": 2000.0000,
"personalDailyLossLimit": 50.0000, // The value at which the violation will trigger
"personalDailyProfitTarget": null,
"voided": false,
"accountName": "U7A120",
"accountType": 1,
"ruleId": null,
"customViolation": null
}
],
"success": true,
"errorMessage": null
}
{
"violations": [
{
"id": 47,
"accountId": 6,
"type": 5, // Type 5 is a PDPT Violation
"duration": 0,
"createdAt": "2024-08-22T18:15:16.882865+00:00",
"triggeredAt": "2024-08-22T18:15:16.876005+00:00",
"expiresAt": "2024-08-22T21:50:00+00:00",
"balance": 49047.4000,
"realizedPnl": -1.4000,
"unrealizedPnl": 0,
"violationBalance": 49072.4000,
"violationTotalDayPnl": 23.6000,
"minimumBalance": 48000.0000,
"dailyLossLimit": 1000.0000,
"personalDailyLossLimit": null,
"personalDailyProfitTarget": 100, // PDPT value, personalized by the Trader
"voided": false,
"accountName": "U7A1",
"accountType": 1,
"ruleId": null,
"customViolation": null
}
],
"success": true,
"errorMessage": null
}
Error: response status is 401