Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1550 from cmroche/origin/product_updates
Browse files Browse the repository at this point in the history
Use script to generate market data for binance, karken and bitfinex and exchange function for lot sizing
  • Loading branch information
askmike committed Jan 21, 2018
2 parents 18a12db + 04b74ea commit c9ec544
Show file tree
Hide file tree
Showing 13 changed files with 4,958 additions and 3,078 deletions.
8 changes: 8 additions & 0 deletions docs/extending/add_an_exchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ The callback needs to have the parameters of `err` and `fee`. Fee is a float tha

The callback needs to have the parameters of `err` and `portfolio`. Portfolio needs to be an array of all currencies and assets combined in the form of objects, an example object looks like `{name: 'BTC', amount: 1.42131}` (name needs to be an uppercase string, amount needs to be a float).

### getLotSize

this.exchange.getLotSize(tradeType, amount, size, callback)

The callback needs to have the parameters of `err` and `lot`. Lot needs to be an object with `amount` and `purchase` size appropriately for the exchange. In the event that the lot is too small, return 0 to both fields and this will generate a lot size warning in the portfolioManager.

Note: This function is currently optional. If not implemented `portfolioManager` will fallback to basic lot sizing mechanism it uses internally. However exchanges are not all the same in how rounding and lot sizing work, it is recommend to implement this function.

### buy

this.exchange.buy(amount, price, callback);
Expand Down
Loading

0 comments on commit c9ec544

Please sign in to comment.