Java service used to periodically run scheduled tasks.
Right now it only tries to finalize long running transactions each 60 seconds.
- Docker
- Java
Swagger endpoint is available at:
# when deployed with k8s
http://SOMEWHERE/engine/api/swagger-ui/
curl -X GET "http://{IP_ADDRESS}:8090/api/trade/scheduler/start" -H "accept: */*"
curl -X GET "http://{IP_ADDRESS}:8090/api/trade/scheduler/status" -H "accept: */*"
curl -X GET "http://{IP_ADDRESS}:8090/api/trade/scheduler/stop" -H "accept: */*"
name | type | data type | description | source |
---|---|---|---|---|
accountId |
required | int | Account ID | Body JSON |
direction |
required | String | Trade direction | Body JSON |
entryPrice |
required | double | Entry price | Body JSON |
id |
required | int | Trade ID | Body JSON |
instrumentId |
required | int | Instrument ID | Body JSON |
quantity |
required | double | Quantity | Body JSON |
status |
required | String | Trade status | Body JSON |
timestampClose |
required | OffsetDateTime | Close timestamp | Body JSON |
timestampOpen |
required | OffsetDateTime | Open timestamp | Body JSON |
tradeClosed |
required | boolean | Trade closed | Body JSON |
transactionHappened |
required | boolean | Trade happened | Body JSON |
{
"accountId": 6,
"direction": "longbuy",
"entryPrice": 178.98,
"id": 12312,
"instrumentId": 1,
"quantity": 10,
"status": "Long buy transaction finished!",
"timestampClose": "2023-08-30T11:11:55.665Z",
"timestampOpen": "2023-08-31T11:11:55.665Z",
"tradeClosed": true,
"transactionHappened": true
}
curl -X POST "http://{IP_ADDRESS}:8090/api/trade/scheduler/notification" -H "accept: */*" -H "Content-Type: application/json" -d '{ "accountId": 6, "direction": "longbuy", "entryPrice": 178.98, "id": 12312, "instrumentId": 1, "quantity": 10, "status": "Long buy transaction finished!", "timestampClose": "2023-08-30T11:11:55.665Z", "timestampOpen": "2023-08-31T11:11:55.665Z", "tradeClosed": true, "transactionHappened": true}'