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

Commit

Permalink
Fix compilation errors
Browse files Browse the repository at this point in the history
References #28
  • Loading branch information
andreashuber69 committed Oct 6, 2017
1 parent 038139a commit d02ad6f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions SmartTrade/TradeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private DateTime GetStart(List<ITransaction> transactions)

if (secondAmount > 0)
{
Info("Amount to trade is {0} {1}.", secondCurrency, secondAmount);
Info("Amount to trade is {0} {1}.", this.Settings.SecondCurrency, secondAmount);

// When we trade fiat on Bitstamp, the fee is calculated as implemented in
// UnitCostAveragingCalculator.GetFee. We always want to sell a bit less than calculated
Expand All @@ -280,7 +280,12 @@ private DateTime GetStart(List<ITransaction> transactions)
this.Settings.LastTradeTime = result.DateTime;
firstBalance += result.Amount;
var bought = result.Amount * result.Price;
popup.Update(this, Resource.String.BoughtPopup, secondCurrency, bought, firstCurrency);
popup.Update(
this,
Resource.String.BoughtPopup,
this.Settings.SecondCurrency,
bought,
this.Settings.FirstCurrency);

start = result.DateTime;
secondAmount = bought + calculator.GetFee(bought);
Expand All @@ -293,7 +298,12 @@ private DateTime GetStart(List<ITransaction> transactions)
this.Settings.LastTradeTime = result.DateTime;
firstBalance -= result.Amount;
var sold = result.Amount * result.Price;
popup.Update(this, Resource.String.SoldPopup, secondCurrency, sold, firstCurrency);
popup.Update(
this,
Resource.String.SoldPopup,
this.Settings.SecondCurrency,
sold,
this.Settings.FirstCurrency);

start = result.DateTime;
secondAmount = sold - calculator.GetFee(sold);
Expand All @@ -310,7 +320,8 @@ private DateTime GetStart(List<ITransaction> transactions)
}

this.Settings.RetryIntervalMilliseconds = MinRetryIntervalMilliseconds;
var nextTradeTime = calculator.GetNextTime(start, buy ? secondBalance : firstBalance * ticker.Bid) - DateTime.UtcNow;
var nextTradeTime =
calculator.GetNextTime(start, buy ? secondBalance : firstBalance * ticker.Bid) - DateTime.UtcNow;

if (!nextTradeTime.HasValue)
{
Expand Down

0 comments on commit d02ad6f

Please sign in to comment.