change algoanalyzer startup for taha

This commit is contained in:
Kevin Darby committed 2019-11-06 21:34:35 -05:00
1 parent a6ef802d3f
commit 0e02428b79
2 files changed
+12 -8

No files matched your search

@@ -18,6 +18,7 @@ namespace bts.history
string[] _security_list;
public AlgoAnalyzer(HistoricalDataOptions options, System.Type algotype, string algo_params)
{
Log.assert(!string.IsNullOrEmpty(options.algo_security));
_security_list = new string[] { options.algo_security };
if (options.algo_security.Contains(';'))
_security_list = options.algo_security.Split(';');
@@ -39,17 +39,20 @@ namespace bts.history
query.Skip = null;
List<IAnalyzer> anal = new List<IAnalyzer>();
string algo_security = o.algo_security;
if (!string.IsNullOrEmpty(algo_security))
string algo_security = o.algo_security ?? string.Empty;
var t = System.Type.GetType(o.algo_type);
if (t == null)
t = System.Type.GetType("bts.history." + o.algo_type);
if (t != null)
{
var t = System.Type.GetType(o.algo_type);
if (t == null)
t = System.Type.GetType("bts.history." + o.algo_type);
if (t != null)
if(typeof(AlgoBase).IsAssignableFrom(t))
anal.Add(new AlgoAnalyzer(o, t, o.algo_params));
else
anal.Add(new BookAnalyzer(algo_security));
else
anal.Add((IAnalyzer)Activator.CreateInstance(t, new[] { algo_security }));
}
else
anal.Add(new BookAnalyzer(algo_security));
api.Product prod = new Product() { Exchange = query.Exchange, Type = query.SecurityType, Symbol = query.Symbol };
List<Entry> arb = new List<Entry>();
int count = 0;