Sync history chart data
SyncChartData¶
Description:
Requests historical candle data from the selected feeder and imports it into the server.
The method supports two modes:
- single-symbol sync when
symbolis provided - group sync when
symbolis omitted, using all symbols fromsec_index
The history window is generated by the server automatically as the last 4 years unless from and to are passed explicitly.
Access Control¶
🛡️ Access Level Required:
SESSION_ADMIN,SESSION_MANAGER,SESSION_DEALER
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
index |
int | âś… | Feeder index (0-200) |
flushData |
int | âś… | Import mode: 0 = replace only the imported time range, 1 = full overwrite |
sec_index |
int | âś… | Security group index used when syncing a symbols list |
symbol |
string | No | Internal symbol name for single-symbol sync |
from |
int64 | No | Start of sync range as Unix timestamp in seconds |
to |
int64 | No | End of sync range as Unix timestamp in seconds |
Behavior¶
Single symbol mode¶
If symbol is provided:
- the server resolves the symbol through
SymbolManager - if the symbol has a non-empty
source, the feeder receivessourceinstead of the internal symbol name - feeder action is set to
GetHistoryBySymbol
Group mode¶
If symbol is not provided:
- the server loads all symbols from
sec_index - for each symbol,
sourceis used when available, otherwise the symbol name is used - feeder action is set to
GetHistoryBySymbolsList
Time range¶
The server builds the sync window as follows:
- if
fromandtoare provided, those values are forwarded to the feeder - otherwise
to= current server time - otherwise
from= current server time minus 4 years
Response¶
| Field | Type | Description |
|---|---|---|
data |
string | Returns "OK" on success |
Example Successful Response¶
{
"data": "OK"
}
Errors¶
| Code | Description |
|---|---|
| 400 | Invalid request data or feeder sync failed |
| 401 | Symbol or security group not found |
Example Request¶
{
"index": 1,
"flushData": 0,
"sec_index": 2,
"symbol": "EURUSD",
"from": 1712448000,
"to": 1775510400
}
Notes¶
flushData = 0does not append blindly; it replaces the imported time range in local historyflushData = 1rewrites the full local candle store for the target import- for single-symbol sync,
sec_indexis still validated by the current server implementation and should be sent fromandtoare optional, but if only one of them is omitted the other one is combined with the server-side default