Merge pull request #20 from exposurem/develop
Binance API bad market fix
This commit is contained in:
commit
cab5375b79
|
@ -68,7 +68,12 @@ namespace Core.MarketAnalyzer
|
|||
foreach (Newtonsoft.Json.Linq.JObject currencyTicker in jsonArray)
|
||||
{
|
||||
string marketName = currencyTicker["symbol"].ToString();
|
||||
//New variables for filtering out bad markets
|
||||
float marketLastPrice = currencyTicker["lastPrice"].ToObject<float>();
|
||||
float marketVolume = currencyTicker["volume"].ToObject<float>();
|
||||
if (marketName.EndsWith(mainMarket, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if(marketLastPrice > 0 && marketVolume > 0 )
|
||||
{
|
||||
|
||||
// Set last values in case any error occurs
|
||||
|
@ -87,6 +92,12 @@ namespace Core.MarketAnalyzer
|
|||
|
||||
result.Add(market.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Let the user know that the problem market was ignored.
|
||||
log.DoLogInfo("Binance - Ignoring bad market data for " + marketName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binance.CheckFirstSeenDates(markets, ref marketInfos, systemConfiguration, log);
|
||||
|
|
Loading…
Reference in New Issue