Skip to content

Commit ddfb36e

Browse files
authored
renamed some remaining market symbols (#733)
1 parent 8eda9c1 commit ddfb36e

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

src/ExchangeSharp/API/Exchanges/Aquanow/ExchangeAquanowAPI.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ private ExchangeAquanowAPI()
3737

3838
protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()
3939
{
40-
List<string> symbols = new List<string>();
40+
List<string> marketSymbols = new List<string>();
4141
JToken token = await MakeJsonRequestAsync<JToken>("/availablesymbols", MarketUrl);
42-
foreach (string symbol in token)
42+
foreach (string marketSymbol in token)
4343
{
44-
symbols.Add(symbol);
44+
marketSymbols.Add(marketSymbol);
4545
}
46-
return symbols;
46+
return marketSymbols;
4747
}
4848

4949
// NOT SUPPORTED

src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ protected async Task<string> ExchangeMarketSymbolToGlobalMarketSymbolWithSeparat
288288
{
289289
if (string.IsNullOrEmpty(marketSymbol))
290290
{
291-
throw new ArgumentException("Symbol must be non null and non empty");
291+
throw new ArgumentException("Market symbol must be non null and non empty");
292292
}
293293
string[] pieces = marketSymbol.Split(separator);
294294
if (MarketSymbolIsReversed == false) //if reversed then put quote currency first
@@ -582,7 +582,7 @@ public string GlobalCurrencyToExchangeCurrency(string currency)
582582
/// Normalize an exchange specific symbol. The symbol should already be in the correct order,
583583
/// this method just deals with casing and putting in the right separator.
584584
/// </summary>
585-
/// <param name="marketSymbol">Symbol</param>
585+
/// <param name="marketSymbol">Market symbol</param>
586586
/// <returns>Normalized symbol</returns>
587587
public virtual string NormalizeMarketSymbol(string? marketSymbol)
588588
{
@@ -649,8 +649,8 @@ public virtual async Task<string> ExchangeMarketSymbolToGlobalMarketSymbolAsync(
649649
/// <returns>Exchange market symbol</returns>
650650
public virtual Task<string> CurrenciesToExchangeMarketSymbol(string baseCurrency, string quoteCurrency)
651651
{
652-
string symbol = (MarketSymbolIsReversed ? $"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}" : $"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}");
653-
return Task.FromResult(MarketSymbolIsUppercase ? symbol.ToUpperInvariant() : symbol);
652+
string marketSymbol = (MarketSymbolIsReversed ? $"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}" : $"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}");
653+
return Task.FromResult(MarketSymbolIsUppercase ? marketSymbol.ToUpperInvariant() : marketSymbol);
654654
}
655655

656656
/// <summary>
@@ -1070,7 +1070,7 @@ public virtual async Task<IEnumerable<ExchangeTransaction>> GetWithdrawHistoryAs
10701070
/// <summary>
10711071
/// Get open margin position
10721072
/// </summary>
1073-
/// <param name="marketSymbol">Symbol</param>
1073+
/// <param name="marketSymbol">Market symbol</param>
10741074
/// <returns>Open margin position result</returns>
10751075
public virtual async Task<ExchangeMarginPositionResult> GetOpenPositionAsync(string marketSymbol)
10761076
{
@@ -1081,7 +1081,7 @@ public virtual async Task<ExchangeMarginPositionResult> GetOpenPositionAsync(str
10811081
/// <summary>
10821082
/// Close a margin position
10831083
/// </summary>
1084-
/// <param name="marketSymbol">Symbol</param>
1084+
/// <param name="marketSymbol">Market symbol</param>
10851085
/// <returns>Close margin position result</returns>
10861086
public virtual async Task<ExchangeCloseMarginPositionResult> CloseMarginPositionAsync(string marketSymbol)
10871087
{

src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public static async Task<Dictionary<string, ExchangeMarket>> GetExchangeMarketDi
244244
/// 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
245245
/// by priceThreshold.
246246
/// </summary>
247-
/// <param name="symbol">Symbol to sell</param>
247+
/// <param name="marketSymbol">Symbol to sell</param>
248248
/// <param name="amount">Amount to sell</param>
249249
/// <param name="isBuy">True for buy, false for sell</param>
250250
/// <param name="orderBookCount">Amount of bids/asks to request in the order book</param>
@@ -254,7 +254,7 @@ public static async Task<Dictionary<string, ExchangeMarket>> GetExchangeMarketDi
254254
/// This ensures that your order does not buy or sell at an extreme margin.</param>
255255
/// <param name="abortIfOrderBookTooSmall">Whether to abort if the order book does not have enough bids or ask amounts to fulfill the order.</param>
256256
/// <returns>Order result</returns>
257-
public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string symbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,
257+
public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string marketSymbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,
258258
decimal thresholdToAbort = 0.75m, bool abortIfOrderBookTooSmall = false)
259259
{
260260
if (priceThreshold > 0.9m)
@@ -270,10 +270,10 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
270270
{
271271
priceThreshold = 1.0m / priceThreshold;
272272
}
273-
ExchangeOrderBook book = await api.GetOrderBookAsync(symbol, orderBookCount);
273+
ExchangeOrderBook book = await api.GetOrderBookAsync(marketSymbol, orderBookCount);
274274
if (book == null || (isBuy && book.Asks.Count == 0) || (!isBuy && book.Bids.Count == 0))
275275
{
276-
throw new APIException($"Error getting order book for {symbol}");
276+
throw new APIException($"Error getting order book for {marketSymbol}");
277277
}
278278
decimal counter = 0m;
279279
decimal highPrice = decimal.MinValue;
@@ -306,11 +306,11 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
306306
}
307307
if (abortIfOrderBookTooSmall && counter < amount)
308308
{
309-
throw new APIException($"{(isBuy ? "Buy" : "Sell") } order for {symbol} and amount {amount} cannot be fulfilled because the order book is too thin.");
309+
throw new APIException($"{(isBuy ? "Buy" : "Sell") } order for {marketSymbol} and amount {amount} cannot be fulfilled because the order book is too thin.");
310310
}
311311
else if (lowPrice / highPrice < thresholdToAbort)
312312
{
313-
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {symbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.");
313+
throw new APIException($"{(isBuy ? "Buy" : "Sell")} order for {marketSymbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.");
314314
}
315315
ExchangeOrderRequest request = new ExchangeOrderRequest
316316
{
@@ -319,7 +319,7 @@ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this Exc
319319
OrderType = OrderType.Limit,
320320
Price = CryptoUtility.RoundAmount((isBuy ? highPrice : lowPrice) * priceThreshold),
321321
ShouldRoundAmount = true,
322-
MarketSymbol = symbol
322+
MarketSymbol = marketSymbol
323323
};
324324
ExchangeOrderResult result = await api.PlaceOrderAsync(request);
325325

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

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

349349
return result;

src/ExchangeSharp/API/Exchanges/_Base/ExchangeLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public static IEnumerable<Dictionary<string, ExchangeTicker>> ReadMultiTickers(s
316316
public IExchangeAPI API { get; private set; }
317317

318318
/// <summary>
319-
/// The symbol being logged
319+
/// The market symbol being logged
320320
/// </summary>
321321
public string MarketSymbol { get; private set; }
322322

src/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
2525
#region Utility Methods
2626

2727
/// <summary>
28-
/// Normalize a symbol for use on this exchange.
28+
/// Normalize a market symbol for use on this exchange.
2929
/// </summary>
3030
/// <param name="marketSymbol">Symbol</param>
3131
/// <returns>Normalized symbol</returns>

src/ExchangeSharp/API/Exchanges/_Base/Interfaces/IOrderBookProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
MIT LICENSE
33
44
Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
@@ -25,7 +25,7 @@ public interface IOrderBookProvider
2525
/// <summary>
2626
/// Get pending orders. Depending on the exchange, the number of bids and asks will have different counts, typically 50-100.
2727
/// </summary>
28-
/// <param name="marketSymbol">Symbol</param>
28+
/// <param name="marketSymbol">Market symbol</param>
2929
/// <param name="maxCount">Max count of bids and asks - not all exchanges will honor this parameter</param>
3030
/// <returns>Orders</returns>
3131
Task<ExchangeOrderBook> GetOrderBookAsync(string marketSymbol, int maxCount = 100);

src/ExchangeSharp/Model/ExchangeTradeInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
MIT LICENSE
33
44
Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
@@ -27,7 +27,7 @@ public sealed class ExchangeTradeInfo
2727
/// Constructor
2828
/// </summary>
2929
/// <param name="info">Exchange info</param>
30-
/// <param name="marketSymbol">The symbol to trade</param>
30+
/// <param name="marketSymbol">Market symbol to trade</param>
3131
public ExchangeTradeInfo(ExchangeInfo info, string marketSymbol)
3232
{
3333
ExchangeInfo = info;

0 commit comments

Comments
 (0)