/// <summary> /// Creates the specified name. /// </summary> /// <param name="name">The name.</param> /// <param name="securitytracker">The securitytracker.</param> /// <param name="tickerweights">The tickerweights.</param> /// <returns></returns> public static Universe Create(string name, SecurityTracker securitytracker, Dictionary <string, decimal> tickerweights) { //Check if all securities are loaded Dictionary <Security, decimal> loadedsecurities = new Dictionary <Security, decimal>(); foreach (var ticker in tickerweights.Keys) { var security = securitytracker[ticker]; if (security is UnknownSecurity) { Log.Warn($"Security with ticker name {ticker} is unknown for the current broker model, it will not be used in universe with name {name}"); } else { loadedsecurities[security] = tickerweights[ticker]; } } //Create new universe object var output = new Universe(loadedsecurities) { Name = name }; //Return result return(output); }
public SQLSecurity() { tracker = new SecurityTracker(null); //trackers = new List<SecurityTracker>(); tokens = new List <string>(); DbDataReader reader = StaticDsnConnection.KindExecuteReader("select * from permission_tokens"); if (reader != null && reader.HasRows) { while (reader.Read()) { tokens.Add((string)reader["name"]); } } }
/// <summary> /// Initializes a new instance of the <see cref="BrokerAccount"/> class. /// </summary> /// <param name="accountid">The accountid.</param> /// <param name="cashmanager">The cashmanager.</param> /// <param name="securitytracker">The securitytracker.</param> /// <param name="accountcurrency">The accountcurrency.</param> /// <param name="leverage">The leverage.</param> /// <param name="displaycurrency">The display currency.</param> public BrokerAccount( string accountid, CashManager cashmanager, SecurityTracker securitytracker, CurrencyType accountcurrency, CurrencyType displaycurrency, int leverage) { Cash = cashmanager; Securities = securitytracker; Positions = new PositionTracker(this); Currency = accountcurrency; Leverage = leverage; Id = accountid; DisplayCurrency = displaycurrency; }
/// <summary> /// Sets the dependencies. /// </summary> /// <param name="securities">The securities.</param> /// <param name="datasubscriptionmanager">The data subscription manager.</param> /// <param name="datafilter"></param> public void SetDependencies(SecurityTracker securities, DataSubscriptionManager datasubscriptionmanager, DataFilter datafilter) { Securities = securities; DataSubscriptionManager = datasubscriptionmanager; DataFilter = datafilter; }