Beispiel #1
0
        //public void AddDefaultStreamers()
        //{
        //    var types = new string[] {};
        //    foreach (var name in types)
        //    {
        //        Type t = Type.GetType(name);
        //        if (t != null)
        //            Streamers.Add(new StreamerPlugin(t.FullName));
        //    }
        //}

        //public void AddDefaultProviders()
        //{
        //    //var types = new Dictionary<string, bool>();
        //    //foreach (var pair in types)
        //    //{
        //    //    Type t = Type.GetType(pair.Key);
        //    //    if (t != null)
        //    //        Providers.Add(new ProviderPlugin(t.FullName, pair.Value));
        //    //}
        //}

        public static Configuration DefaultConfiguaration()
        {
            var c = new Configuration();

            c.IsInstrumentFileLocal = true;
            c.InstrumentFileHost = "127.0.0.1";
            c.InstrumentFileName = Path.Combine(Installation.DataDir.FullName, "instruments.quant");
            c.IsDataFileLocal = true;
            c.DataFileHost = "127.0.0.1";
            c.DataFileName = Path.Combine(Installation.DataDir.FullName, "data.quant");

            c.IsOrderFileLocal = true;
            c.OrderFileHost = "127.0.0.1";
            c.OrderFilePort = 1000;
            c.OrderFileName = Path.Combine(Installation.DataDir.FullName, "orders.quant");

            c.DefaultCurrency = "USD";
            c.DefaultExchange = "SMART";
            c.DefaultDataProvider = "QuantRouter";
            c.DefaultExecutionProvider = "QuantRouter";
            c.ProviderManagerFileName = Path.Combine(Installation.ConfigDir.FullName, "providermanager.xml");

            c.Streamers = new List<StreamerPlugin>();
            c.AddDefaultStreamers();
            c.Providers = new List<ProviderPlugin>();
            c.AddDefaultProviders();

            c.ServerFactoryType = "DefaultServerFactory";
            return c;
        }