Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ExchangeSharp/API/Exchanges/Aquanow/ExchangeAquanowAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ private ExchangeAquanowAPI()

protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()
{
List<string> symbols = new List<string>();
List<string> marketSymbols = new List<string>();
JToken token = await MakeJsonRequestAsync<JToken>("/availablesymbols", MarketUrl);
foreach (string symbol in token)
foreach (string marketSymbol in token)
{
symbols.Add(symbol);
marketSymbols.Add(marketSymbol);
}
return symbols;
return marketSymbols;
}

// NOT SUPPORTED
Expand Down
12 changes: 6 additions & 6 deletions src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ protected async Task<string> ExchangeMarketSymbolToGlobalMarketSymbolWithSeparat
{
if (string.IsNullOrEmpty(marketSymbol))
{
throw new ArgumentException("Symbol must be non null and non empty");
throw new ArgumentException("Market symbol must be non null and non empty");
}
string[] pieces = marketSymbol.Split(separator);
if (MarketSymbolIsReversed == false) //if reversed then put quote currency first
Expand Down Expand Up @@ -582,7 +582,7 @@ public string GlobalCurrencyToExchangeCurrency(string currency)
/// Normalize an exchange specific symbol. The symbol should already be in the correct order,
/// this method just deals with casing and putting in the right separator.
/// </summary>
/// <param name="marketSymbol">Symbol</param>
/// <param name="marketSymbol">Market symbol</param>
/// <returns>Normalized symbol</returns>
public virtual string NormalizeMarketSymbol(string? marketSymbol)
{
Expand Down Expand Up @@ -649,8 +649,8 @@ public virtual async Task<string> ExchangeMarketSymbolToGlobalMarketSymbolAsync(
/// <returns>Exchange market symbol</returns>
public virtual Task<string> CurrenciesToExchangeMarketSymbol(string baseCurrency, string quoteCurrency)
{
string symbol = (MarketSymbolIsReversed ? $"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}" : $"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}");
return Task.FromResult(MarketSymbolIsUppercase ? symbol.ToUpperInvariant() : symbol);
string marketSymbol = (MarketSymbolIsReversed ? $"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}" : $"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}");
return Task.FromResult(MarketSymbolIsUppercase ? marketSymbol.ToUpperInvariant() : marketSymbol);
}

/// <summary>
Expand Down Expand Up @@ -1070,7 +1070,7 @@ public virtual async Task<IEnumerable<ExchangeTransaction>> GetWithdrawHistoryAs
/// <summary>
/// Get open margin position
/// </summary>
/// <param name="marketSymbol">Symbol</param>
/// <param name="marketSymbol">Market symbol</param>
/// <returns>Open margin position result</returns>
public virtual async Task<ExchangeMarginPositionResult> GetOpenPositionAsync(string marketSymbol)
{
Expand All @@ -1081,7 +1081,7 @@ public virtual async Task<ExchangeMarginPositionResult> GetOpenPositionAsync(str
/// <summary>
/// Close a margin position
/// </summary>
/// <param name="marketSymbol">Symbol</param>
/// <param name="marketSymbol">Market symbol</param>
/// <returns>Close margin position result</returns>
public virtual async Task<ExchangeCloseMarginPositionResult> CloseMarginPositionAsync(string marketSymbol)
{
Expand Down
18 changes: 9 additions & 9 deletions src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public static async Task<Dictionary<string, ExchangeMarket>> GetExchangeMarketDi
/// The order book is scanned until an amount of bids or asks that will fulfill the order is found and then the order is placed at the lowest bid or highest ask price multiplied
/// by priceThreshold.
/// </summary>
/// <param name="symbol">Symbol to sell</param>
/// <param name="marketSymbol">Symbol to sell</param>
/// <param name="amount">Amount to sell</param>
/// <param name="isBuy">True for buy, false for sell</param>
/// <param name="orderBookCount">Amount of bids/asks to request in the order book</param>
Expand All @@ -254,7 +254,7 @@ public static async Task<Dictionary<string, ExchangeMarket>> GetExchangeMarketDi
/// This ensures that your order does not buy or sell at an extreme margin.</param>
/// <param name="abortIfOrderBookTooSmall">Whether to abort if the order book does not have enough bids or ask amounts to fulfill the order.</param>
/// <returns>Order result</returns>
public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string symbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,
public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string marketSymbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,
decimal thresholdToAbort = 0.75m, bool abortIfOrderBookTooSmall = false)
{
if (priceThreshold > 0.9m)
Expand All @@ -270,10 +270,10 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
{
priceThreshold = 1.0m / priceThreshold;
}
ExchangeOrderBook book = await api.GetOrderBookAsync(symbol, orderBookCount);
ExchangeOrderBook book = await api.GetOrderBookAsync(marketSymbol, orderBookCount);
if (book == null || (isBuy && book.Asks.Count == 0) || (!isBuy && book.Bids.Count == 0))
{
throw new APIException($"Error getting order book for {symbol}");
throw new APIException($"Error getting order book for {marketSymbol}");
}
decimal counter = 0m;
decimal highPrice = decimal.MinValue;
Expand Down Expand Up @@ -306,11 +306,11 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
}
if (abortIfOrderBookTooSmall && counter < amount)
{
throw new APIException($"{(isBuy ? "Buy" : "Sell") } order for {symbol} and amount {amount} cannot be fulfilled because the order book is too thin.");
throw new APIException($"{(isBuy ? "Buy" : "Sell") } order for {marketSymbol} and amount {amount} cannot be fulfilled because the order book is too thin.");
}
else if (lowPrice / highPrice < thresholdToAbort)
{
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {symbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.");
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {marketSymbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.");
}
ExchangeOrderRequest request = new ExchangeOrderRequest
{
Expand All @@ -319,7 +319,7 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
OrderType = OrderType.Limit,
Price = CryptoUtility.RoundAmount((isBuy ? highPrice : lowPrice) * priceThreshold),
ShouldRoundAmount = true,
MarketSymbol = symbol
MarketSymbol = marketSymbol
};
ExchangeOrderResult result = await api.PlaceOrderAsync(request);

Expand All @@ -329,7 +329,7 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
for (; i < maxTries; i++)
{
await System.Threading.Tasks.Task.Delay(500);
result = await api.GetOrderDetailsAsync(result.OrderId, marketSymbol: symbol);
result = await api.GetOrderDetailsAsync(result.OrderId, marketSymbol: marketSymbol);
switch (result.Result)
{
case ExchangeAPIOrderResult.Filled:
Expand All @@ -343,7 +343,7 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc

if (i == maxTries)
{
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {symbol} and amount {amount} timed out and may not have been fulfilled");
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {marketSymbol} and amount {amount} timed out and may not have been fulfilled");
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion src/ExchangeSharp/API/Exchanges/_Base/ExchangeLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public static IEnumerable<Dictionary<string, ExchangeTicker>> ReadMultiTickers(s
public IExchangeAPI API { get; private set; }

/// <summary>
/// The symbol being logged
/// The market symbol being logged
/// </summary>
public string MarketSymbol { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion src/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
#region Utility Methods

/// <summary>
/// Normalize a symbol for use on this exchange.
/// Normalize a market symbol for use on this exchange.
/// </summary>
/// <param name="marketSymbol">Symbol</param>
/// <returns>Normalized symbol</returns>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
MIT LICENSE

Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
Expand All @@ -25,7 +25,7 @@ public interface IOrderBookProvider
/// <summary>
/// Get pending orders. Depending on the exchange, the number of bids and asks will have different counts, typically 50-100.
/// </summary>
/// <param name="marketSymbol">Symbol</param>
/// <param name="marketSymbol">Market symbol</param>
/// <param name="maxCount">Max count of bids and asks - not all exchanges will honor this parameter</param>
/// <returns>Orders</returns>
Task<ExchangeOrderBook> GetOrderBookAsync(string marketSymbol, int maxCount = 100);
Expand Down
4 changes: 2 additions & 2 deletions src/ExchangeSharp/Model/ExchangeTradeInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
MIT LICENSE

Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
Expand Down Expand Up @@ -27,7 +27,7 @@ public sealed class ExchangeTradeInfo
/// Constructor
/// </summary>
/// <param name="info">Exchange info</param>
/// <param name="marketSymbol">The symbol to trade</param>
/// <param name="marketSymbol">Market symbol to trade</param>
public ExchangeTradeInfo(ExchangeInfo info, string marketSymbol)
{
ExchangeInfo = info;
Expand Down