API to get trading history. Brokers to pass historical data from message queue to storage. Below is the API description.
- Pull "mttradinghistoryapi" docker image with a corresponding tag.
- Configure environment variables according to "Environment variables" section.
- Put secrets.json with endpoint data including the certificate:
{
"Kestrel": {
"EndPoints": {
"HttpsInlineCertFile": {
"Url": "https://*:5041",
"Certificate": {
"Path": "<path to .pfx file>",
"Password": "<certificate password>"
}
}
}
}
}
- Initialize all dependencies.
- Run.
- Clone repo to some directory.
- In MarginTrading.TradingHistory root create a appsettings.dev.json with settings.
- Add environment variable "SettingsUrl": "appsettings.dev.json".
- VPN to a corresponding env must be connected and all dependencies must be initialized.
- Run.
TBD
Kestrel configuration may be passed through appsettings.json, secrets or environment. All variables and value constraints are default. For instance, to set host URL the following env variable may be set:
{
"Kestrel__EndPoints__Http__Url": "http://*:5040"
}
- RESTART_ATTEMPTS_NUMBER - number of restart attempts. If not set int.MaxValue is used.
- RESTART_ATTEMPTS_INTERVAL_MS - interval between restarts in milliseconds. If not set 10000 is used.
- SettingsUrl - defines URL of remote settings or path for local settings.
TradingHistoryService settings schema is:
{
"APP_UID": "Integer",
"ASPNETCORE_ENVIRONMENT": "String",
"ENVIRONMENT": "String",
"IsLive": "Boolean",
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "String"
}
}
},
"serilog": {
"minimumLevel": {
"default": "String"
}
},
"TradingHistoryClient": {
"ApiKey": "String",
"ServiceUrl": "String"
},
"TradingHistoryService": {
"ApiKey": "String",
"Db": {
"HistoryConnString": "String",
"LogsConnString": "String",
"OrderBlotterExecutionTimeout": "DateTime",
"StorageMode": "String"
},
"UseSerilog": "Boolean"
},
"TZ": "String"
}
OrderHistoryBroker settings schema is:
{
"APP_UID": "Integer",
"ASPNETCORE_ENVIRONMENT": "String",
"ENVIRONMENT": "String",
"IsLive": "Boolean",
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "String"
}
}
},
"MtBrokerSettings": {
"CancelledTradeIdAttributeName": "String",
"ConsumerCount": "Integer",
"Db": {
"ConnString": "String",
"StorageMode": "String"
},
"IsCancellationTradeAttributeName": "String",
"MtRabbitMqConnString": "String",
"RabbitMqQueues": {
"OrderHistory": {
"ExchangeName": "String"
}
}
},
"MtBrokersLogs": {
"LogsConnString": "String",
"StorageMode": "String",
"UseSerilog": "Boolean"
},
"serilog": {
"Enrich": [
"String"
],
"minimumLevel": {
"default": "String"
},
"Properties": {
"Application": "String"
},
"Using": [
"String"
],
"writeTo": [
{
"Args": {
"configure": [
{
"Args": {
"outputTemplate": "String"
},
"Name": "String"
}
]
},
"Name": "String"
}
]
},
"TZ": "String"
}
PositionHistoryBroker settings schema is:
{
"APP_UID": "Integer",
"ASPNETCORE_ENVIRONMENT": "String",
"ENVIRONMENT": "String",
"IsLive": "Boolean",
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "String"
}
}
},
"MtBrokerSettings": {
"ConsumerCount": "Integer",
"Db": {
"ConnString": "String",
"StorageMode": "String"
},
"MtRabbitMqConnString": "String",
"RabbitMqQueues": {
"PositionsHistory": {
"ExchangeName": "String"
},
"Trades": {
"ExchangeName": "String"
}
}
},
"MtBrokersLogs": {
"LogsConnString": "String",
"StorageMode": "String",
"UseSerilog": "Boolean"
},
"serilog": {
"Enrich": [
"String"
],
"minimumLevel": {
"default": "String"
},
"Properties": {
"Application": "String"
},
"Using": [
"String"
],
"writeTo": [
{
"Args": {
"configure": [
{
"Args": {
"outputTemplate": "String"
},
"Name": "String"
}
]
},
"Name": "String"
}
]
},
"TZ": "String"
}