Skip to content

Commit

Permalink
better support for dry-run without API keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ondra-novak committed Oct 2, 2019
1 parent c2318d0 commit f1b4107
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions www/admin/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,12 @@ function filledval(v,w) {

function powerToEA(power, pair) {
var total;
var bal = pair.currency_balance || (pair.price*100);
if (pair.leverage) {
total = pair.currency_balance / pair.price;
total = bal / pair.price;
return power * total;
} else {
total = pair.currency_balance / pair.price + pair.asset_balance;
total = bal / pair.price + pair.asset_balance;
return power * total;
}
}
Expand Down

0 comments on commit f1b4107

Please sign in to comment.