An app to alert / display changes in forex spot prices
Spot Change
Rising Rates
To run app:
- run
yarn start
- (optional) To run with your own input file, run
yarn start [PATH TO DATA FILE]
Example:
yarn start `pwd`/data/myinput2_spot_change.jsonl
yarn start `pwd`/data/myinput3_trend_rising.jsonl
To run test:
- run
yarn test
Implementation details:
- Calculate 5 min average, trends (rising/falling), alerting methods when thresholds are triggered for one currency pair (ie: src/lib/Rate.ts)
- Scale implementation to handle multiple currency pairs in data stream (ie: src/lib/CurrencyPairs.ts)
- Simulate data stream to appear sequentially to app (ie: src/run.ts)
- The definition of a "5 minute average" is based on a simple moving average calculation where we take an average of the rates for the last 5 minutes/300 seconds at every second of streamed data received.
- Streaming data comes in sequentially
- Utility functions to "simulate" the flow of data is not tested as its just for demonstration purposes (ie: src/lib/utils.ts)