Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 2.35 KB

README.md

File metadata and controls

57 lines (36 loc) · 2.35 KB

README

In order to make life easier I suggest forking this repository into your own github account. Submission is as simple as committing all your work to github and telling us about your github URI.

THE DATA

Assume all prices are in dollars.

There are 2 csv files included in this task, prices.csv and trades.csv

In prices.csv you will find 3 columns. The format is as follows:

  1. timestamp - the time at which the price change occurred
  2. bid price - the bid price on the exchange
  3. ask price - the asking price on the exchange

In trades.csv you will find 4 columns. The format is as follows:

  1. identifier - unique id for this trade
  2. trade type - buy or sell
  3. opening price - the price the trade was opened at
  4. margin (the movement in price that is acceptable before a trade should be liquidated).

THE TASK

To create a liquidation system that accepts the price data, feeds it in, and liquidates any of the trades from the trade data that exceed their stop margin. The stop price for a Buy is open price - margin, .e.g 700 - 20 = 680 stop price.

The output should be a list of the trades that were liquidated, in the order they were liquidated, and the timestamp and price they were liquidated against.

e.g. If a Buy trade (id:9) is opened at $700 with a margin of $20, then the trade should be marked as liquidated if the price reaches 680 or below. Output: 9 679 (note 679 is below 680)

The finished task should be runnable out of the box. And should be tested. How you choose to implement the rest is entirely up to you. All source code should be supplied so that evaluation can be completed on code quality.

FAQ

Q. Can I use libraries?

A. Yes, use whatever you're comfortable with. Make sure to demonstrate your understanding and skills with the language however.

Q. How does the user interact with it?

A. The "user" doesn't. There is not intended to be any user interaction, it's machine only. The input is processed by your program, and the output is generated by your program. The program should be able to run once and output the correctly liquidated trades.

Q. How do you want the output? Screen/File/Storage?

A. That is left to the programmers discretion. So long as the output can be verified after the program has run. Bear in mind any usage of data storage mechanisms should be easily replicable by us.