-
Notifications
You must be signed in to change notification settings - Fork 0
Front End Function Requirements
Mark7124 edited this page Mar 23, 2017
·
17 revisions
| Function | Purpose | Returns | Example Output |
| getMarkets | Returns a list of markets that data exists for. |
[ { UID: number, Name: string } ] |
[ {1500, 'FTSE 100'}, {1400, 'Dow Jones'}, {1232, 'Crude Oil'} ] |
| getTrendSources | Returns a list of trend sources that data exists for. |
[ { UID: number, Name: string } ] |
[ 'Facebook', 'Twitter' ] |
| getNewsSources | Returns a list of news sources that data exists for. |
[ { UID: number, Name: string } ] |
[ 'BBC News', 'Reuters' ] |
| getMarketData(UID: number, startDate: date, endDate: date) | Returns data from the market with requested UID, startDate and endDate. If no data exists, the splits property should be set to 0. Otherwise, any data for the requested date range should be returned. |
{ timePeriod: { "start": date, "end": date, "splits": number }, data: [number] } |
getMarkedData(UID = 1001, startDate = "01/03/2017", endDate = "31/03/2017") = { timePeriod: { "start": "05/03/2017", "end": "18/03/2017", "splits": 14 }, data: [ 123.3, 423.3, 232.3, 423.3, 434.4, 532.1, 494.2, 246.5, 533.3, 543.2, 423.4, 429.0, 496.7, 382.1 ] } |
Dates should be strings of format 'dd/mm/yyyy'.
UIDs for markets should begin with a 1, and should be tabulated here:
| UID | Market Name |
| ... | ... |
| UID | Trend Source |
| ... | ... |
| UID | News Article Source |
| ... | ... |