Merge pull request #289 from HojouFotytu/develop
Ignored/Allowed in SMS && BinanceFutures Quarterly Contracts
This commit is contained in:
commit
4d16970b9b
|
@ -903,6 +903,28 @@ namespace Core.Main
|
||||||
// Check for single market trend triggers
|
// Check for single market trend triggers
|
||||||
this.ApplySingleMarketSettings();
|
this.ApplySingleMarketSettings();
|
||||||
|
|
||||||
|
// Ignore quarterly futures
|
||||||
|
if (this.PTMagicConfiguration.GeneralSettings.Application.Exchange.Equals("BinanceFutures", StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
{
|
||||||
|
// Find all quarterly futures pairs
|
||||||
|
var results = this.MarketList.FindAll(m => m.Contains("_", StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
|
// Create the settings lines to disable trading
|
||||||
|
if (results.Count > 0)
|
||||||
|
{
|
||||||
|
this.PairsLines.AddRange(new string[] {
|
||||||
|
"",
|
||||||
|
"# BinanceFutures Quarterly Contracts - Ignore list:",
|
||||||
|
"###################################################"
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var marketPair in results)
|
||||||
|
{
|
||||||
|
this.PairsLines.Add(String.Format("{0}_trading_enabled = false", marketPair));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Save new properties to Profit Trailer
|
// Save new properties to Profit Trailer
|
||||||
this.SaveProfitTrailerProperties();
|
this.SaveProfitTrailerProperties();
|
||||||
|
|
||||||
|
@ -1518,7 +1540,7 @@ namespace Core.Main
|
||||||
|
|
||||||
// Check ignore markets
|
// Check ignore markets
|
||||||
List<string> ignoredMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.IgnoredMarkets, ",");
|
List<string> ignoredMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.IgnoredMarkets, ",");
|
||||||
if (ignoredMarkets.Contains(marketPair))
|
if (ignoredMarkets.Any(marketPair.Contains))
|
||||||
{
|
{
|
||||||
this.Log.DoLogDebug("'" + marketPair + "' - Is ignored in '" + marketSetting.SettingName + "'.");
|
this.Log.DoLogDebug("'" + marketPair + "' - Is ignored in '" + marketSetting.SettingName + "'.");
|
||||||
continue;
|
continue;
|
||||||
|
@ -1526,7 +1548,7 @@ namespace Core.Main
|
||||||
|
|
||||||
// Check allowed markets
|
// Check allowed markets
|
||||||
List<string> allowedMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.AllowedMarkets, ",");
|
List<string> allowedMarkets = SystemHelper.ConvertTokenStringToList(marketSetting.AllowedMarkets, ",");
|
||||||
if (allowedMarkets.Count > 0 && !allowedMarkets.Contains(marketPair))
|
if (allowedMarkets.Count > 0 && !allowedMarkets.Any(am => marketPair.StartsWith(am, StringComparison.InvariantCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
this.Log.DoLogDebug("'" + marketPair + "' - Is not allowed in '" + marketSetting.SettingName + "'.");
|
this.Log.DoLogDebug("'" + marketPair + "' - Is not allowed in '" + marketSetting.SettingName + "'.");
|
||||||
continue;
|
continue;
|
||||||
|
@ -1534,7 +1556,7 @@ namespace Core.Main
|
||||||
|
|
||||||
// Check ignore global settings
|
// Check ignore global settings
|
||||||
List<string> ignoredGlobalSettings = SystemHelper.ConvertTokenStringToList(marketSetting.IgnoredGlobalSettings, ",");
|
List<string> ignoredGlobalSettings = SystemHelper.ConvertTokenStringToList(marketSetting.IgnoredGlobalSettings, ",");
|
||||||
if (ignoredGlobalSettings.Contains(this.ActiveSettingName))
|
if (ignoredMarkets.Any(im => marketPair.StartsWith(im, StringComparison.InvariantCultureIgnoreCase)))
|
||||||
{
|
{
|
||||||
this.Log.DoLogDebug("'" + marketPair + "' - '" + this.ActiveSettingName + "' - Is ignored in '" + marketSetting.SettingName + "'.");
|
this.Log.DoLogDebug("'" + marketPair + "' - '" + this.ActiveSettingName + "' - Is ignored in '" + marketSetting.SettingName + "'.");
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -74,9 +74,7 @@ namespace Core.MarketAnalyzer
|
||||||
//New variables for filtering out bad markets
|
//New variables for filtering out bad markets
|
||||||
float marketLastPrice = currencyTicker["lastPrice"].ToObject<float>();
|
float marketLastPrice = currencyTicker["lastPrice"].ToObject<float>();
|
||||||
float marketVolume = currencyTicker["volume"].ToObject<float>();
|
float marketVolume = currencyTicker["volume"].ToObject<float>();
|
||||||
if (marketName.EndsWith(mainMarket, StringComparison.InvariantCultureIgnoreCase))
|
if (marketLastPrice > 0 && marketVolume > 0)
|
||||||
{
|
|
||||||
if (marketLastPrice > 0 && marketVolume > 0)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
// Set last values in case any error occurs
|
// Set last values in case any error occurs
|
||||||
|
@ -100,7 +98,6 @@ namespace Core.MarketAnalyzer
|
||||||
//Let the user know that the problem market was ignored.
|
//Let the user know that the problem market was ignored.
|
||||||
log.DoLogInfo("BinanceFutures - Ignoring bad market data for " + marketName);
|
log.DoLogInfo("BinanceFutures - Ignoring bad market data for " + marketName);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BinanceFutures.CheckFirstSeenDates(markets, ref marketInfos, systemConfiguration, log);
|
BinanceFutures.CheckFirstSeenDates(markets, ref marketInfos, systemConfiguration, log);
|
||||||
|
|
Loading…
Reference in New Issue