Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added the idea of a "total balance" in case we want to modify the amo…
…unt to equal that
  • Loading branch information
Michael Murray committed Feb 9, 2014
commit 117cde76233aaab3476ac6b8aa109568fabd20e9
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*.vi
*~
*.sass-cache
gekko-conf*


# OS or Editor folders
.DS_Store
Expand Down Expand Up @@ -38,4 +40,5 @@ dwsync.xml
node_modules
candles.csv
cexio.db
cryptsy.db
history
4 changes: 3 additions & 1 deletion core/portfolioManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ Manager.prototype.trade = function(what) {
return;

var act = function() {
var amount, price;
var amount, price, total_balance;

total_balance = this.getBalance(this.currency) + this.getBalance(this.asset) * this.ticker.bid;

if(what === 'BUY') {

Expand Down