Beispiel #1
0
 public static void AddList(InstrumentList list)
 {
     if (InstrumentManager.instrumentLists.Contains(list.Name))
     {
         InstrumentManager.RemoveList(list.Name);
     }
     InstrumentManager.instrumentLists.Add(list.Name, list);
 }
Beispiel #2
0
 private void trvInstruments_MouseMove(object sender, MouseEventArgs e)
 {
     if ((e.Button & MouseButtons.Left) != MouseButtons.Left || !(this.dragBoxFromMouseDown != Rectangle.Empty))
     {
         return;
     }
     if (this.dragBoxFromMouseDown.Contains(e.X, e.Y))
     {
         return;
     }
     try
     {
         this.myNormalCursor = Cursors.Arrow;
         this.myNoDropCursor = Cursors.Hand;
     }
     catch
     {
     }
     finally
     {
         this.screenOffset = SystemInformation.WorkingArea.Location;
         InstrumentList instrumentList = new InstrumentList();
         if (this.nodeToDrag is InstrumentNode)
         {
             instrumentList.Add((this.nodeToDrag as InstrumentNode).Instrument);
         }
         if (this.nodeToDrag is GroupNode)
         {
             foreach (InstrumentNode instrumentNode in this.nodeToDrag.Nodes)
             {
                 instrumentList.Add(instrumentNode.Instrument);
             }
         }
         int num = (int)this.trvInstruments.DoDragDrop(instrumentList, DragDropEffects.Move);
     }
 }
Beispiel #3
0
 private void trvInstruments_MouseMove(object sender, MouseEventArgs e)
 {
   if ((e.Button & MouseButtons.Left) != MouseButtons.Left || !(this.dragBoxFromMouseDown != Rectangle.Empty))
     return;
   if (this.dragBoxFromMouseDown.Contains(e.X, e.Y))
     return;
   try
   {
     this.myNormalCursor = Cursors.Arrow;
     this.myNoDropCursor = Cursors.Hand;
   }
   catch
   {
   }
   finally
   {
     this.screenOffset = SystemInformation.WorkingArea.Location;
     InstrumentList instrumentList = new InstrumentList();
     if (this.nodeToDrag is InstrumentNode)
       instrumentList.Add((this.nodeToDrag as InstrumentNode).Instrument);
     if (this.nodeToDrag is GroupNode)
     {
       foreach (InstrumentNode instrumentNode in this.nodeToDrag.Nodes)
         instrumentList.Add(instrumentNode.Instrument);
     }
     int num = (int) this.trvInstruments.DoDragDrop(instrumentList, DragDropEffects.Move);
   }
 }
Beispiel #4
0
 private void ctxPanel_Remove_Click(object sender, EventArgs e)
 {
   InstrumentList instrumentList = new InstrumentList();
   foreach (InstrumentRow instrumentRow in (BaseCollection) this.dgvPanel.SelectedRows)
     instrumentList.Add(instrumentRow.Instrument);
   if (((FIXGroupList) instrumentList).Count <= 0 || MessageBox.Show("Do you want to remove selected instruments?", "Remove", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
     return;
   IEnumerator enumerator = ((FIXGroupList) instrumentList).GetEnumerator();
   try
   {
     while (enumerator.MoveNext())
       this.RemoveInstrument((Instrument) enumerator.Current);
   }
   finally
   {
     IDisposable disposable = enumerator as IDisposable;
     if (disposable != null)
       disposable.Dispose();
   }
 }
Beispiel #5
0
    protected StrategyBase(string name, string description)
    {
      this.metaStrategyBase = (MetaStrategyBase) null;
      this.name = name;
      this.description = description;
      this.isEnabled = true;
      this.isActive = true;
			this.ReportManager = StrategyComponentManager.GetComponent("getcom", (object) this) as ReportManager;
			this.MarketManager = StrategyComponentManager.GetComponent("getcom", (object) this) as MarketManager;
      this.portfolio = PortfolioManager.Portfolios[name];
      if (this.portfolio == null)
        this.portfolio = new Portfolio(name);
      this.tester = new LiveTester(this.portfolio);
      this.stops = new StopList();
      this.triggers = new TriggerList();
      this.marketDataProvider = (IMarketDataProvider) null;
      this.executionProvider = (IExecutionProvider) null;
      this.newsProvider = (INewsProvider) null;
      this.executionService = (IExecutionService) null;
      this.orders = new OrderTable();
      this.global = new Hashtable();
      this.activeInstruments = new InstrumentList();
      this.barSliceManager = new BarSliceManager();
      this.componentTypeList = new List<ComponentType>();
      this.componentTypeList.Add(ComponentType.MarketManager);
      this.componentTypeList.Add(ComponentType.ReportManager);
      this.activeStops = new Dictionary<Instrument, List<StopBase>>();
      this.portfolios = new Dictionary<Instrument, Portfolio>();
      this.testers = new Dictionary<Instrument, LiveTester>();
      this.statisticsPerInstrumentEnabled = false;
    }
Beispiel #6
0
 public InstrumentList Load()
 {
     IDbCommand command1 = this.connection.CreateCommand();
     command1.CommandText = "comdd";
     IDataReader dataReader1 = command1.ExecuteReader();
     while (dataReader1.Read())
     {
         int int32 = dataReader1.GetInt32(0);
         Type type = Type.GetType(dataReader1.GetString(1));
         this.aKpdKBGUfP.Add(int32, type);
         this.cVFd9nJe3b.Add(type, int32);
     }
     dataReader1.Close();
     command1.Dispose();
     IDbCommand command2 = this.connection.CreateCommand();
     command2.CommandText = "load";
     IDataReader dataReader2 = command2.ExecuteReader();
     while (dataReader2.Read())
     {
         int int32 = dataReader2.GetInt32(0);
         Type type = Type.GetType(dataReader2.GetString(1));
         this.BuYdCExFpF.Add(int32, type);
         this.UXKdMsMyXN.Add(type, int32);
     }
     dataReader2.Close();
     command2.Dispose();
     InstrumentList instrumentList = new InstrumentList();
     IDbCommand command3 = this.connection.CreateCommand();
     command3.CommandText = "load";
     IDataReader dataReader3 = command3.ExecuteReader();
     while (dataReader3.Read())
     {
         int int32 = dataReader3.GetInt32(0);
         Type type1 = this.aKpdKBGUfP[dataReader3.GetInt32(1)];
         Type type2 = this.BuYdCExFpF[dataReader3.GetInt32(2)];
         string @string = dataReader3.GetString(3);
         Instrument instrument = Activator.CreateInstance(type1, true) as Instrument;
         IPricer pricer = Activator.CreateInstance(type2) as IPricer;
         instrument.Symbol = @string;
         instrument.Id = int32;
         instrument.Pricer = pricer;
         if (instrumentList[@string] == null)
             instrumentList.Add(instrument);
     }
     dataReader3.Close();
     command3.Dispose();
     FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)instrumentList, "fsdfs");
     LegList legList = new LegList();
     IDbCommand command4 = this.connection.CreateCommand();
     command4.CommandText = "load";
     IDataReader dataReader4 = command4.ExecuteReader();
     while (dataReader4.Read())
     {
         int int32_1 = dataReader4.GetInt32(0);
         int int32_2 = dataReader4.GetInt32(1);
         int int32_3 = dataReader4.GetInt32(2);
         Leg leg = new Leg(instrumentList.GetById(int32_3));
         leg.Id = int32_1;
         instrumentList.GetById(int32_2).Legs.Add((FIXGroup)leg);
         legList.Add((FIXGroup)leg);
     }
     dataReader4.Close();
     command4.Dispose();
     FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)legList, "");
     UnderlyingList underlyingList = new UnderlyingList();
     IDbCommand command5 = this.connection.CreateCommand();
     command5.CommandText = "load";
     IDataReader dataReader5 = command5.ExecuteReader();
     while (dataReader5.Read())
     {
         int int32_1 = dataReader5.GetInt32(0);
         int int32_2 = dataReader5.GetInt32(1);
         int int32_3 = dataReader5.GetInt32(2);
         Underlying underlying = new Underlying(instrumentList.GetById(int32_3));
         underlying.Id = int32_1;
         instrumentList.GetById(int32_2).Underlyings.Add((FIXGroup)underlying);
         underlyingList.Add((FIXGroup)underlying);
     }
     dataReader5.Close();
     command5.Dispose();
     FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)underlyingList, "dss");
     FIXSecurityAltIDGroupList securityAltIdGroupList = new FIXSecurityAltIDGroupList();
     IDbCommand command6 = this.connection.CreateCommand();
     command6.CommandText = "load";
     IDataReader dataReader6 = command6.ExecuteReader();
     while (dataReader6.Read())
     {
         int int32_1 = dataReader6.GetInt32(0);
         int int32_2 = dataReader6.GetInt32(1);
         FIXSecurityAltIDGroup securityAltIdGroup = new FIXSecurityAltIDGroup();
         securityAltIdGroup.Id = int32_1;
         instrumentList.GetById(int32_2).SecurityAltIDGroup.Add((FIXGroup)securityAltIdGroup);
         securityAltIdGroupList.Add((FIXGroup)securityAltIdGroup);
     }
     dataReader6.Close();
     command6.Dispose();
     FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)securityAltIdGroupList, "fsfs");
     return instrumentList;
 }
Beispiel #7
0
		public static void AddList(InstrumentList list)
		{
			if (InstrumentManager.instrumentLists.Contains(list.Name))
				InstrumentManager.RemoveList(list.Name);
			InstrumentManager.instrumentLists.Add(list.Name, list);
		}
Beispiel #8
0
        public InstrumentList Load()
        {
            IDbCommand command1 = this.connection.CreateCommand();

            command1.CommandText = "comdd";
            IDataReader dataReader1 = command1.ExecuteReader();

            while (dataReader1.Read())
            {
                int  int32 = dataReader1.GetInt32(0);
                Type type  = Type.GetType(dataReader1.GetString(1));
                this.aKpdKBGUfP.Add(int32, type);
                this.cVFd9nJe3b.Add(type, int32);
            }
            dataReader1.Close();
            command1.Dispose();
            IDbCommand command2 = this.connection.CreateCommand();

            command2.CommandText = "load";
            IDataReader dataReader2 = command2.ExecuteReader();

            while (dataReader2.Read())
            {
                int  int32 = dataReader2.GetInt32(0);
                Type type  = Type.GetType(dataReader2.GetString(1));
                this.BuYdCExFpF.Add(int32, type);
                this.UXKdMsMyXN.Add(type, int32);
            }
            dataReader2.Close();
            command2.Dispose();
            InstrumentList instrumentList = new InstrumentList();
            IDbCommand     command3       = this.connection.CreateCommand();

            command3.CommandText = "load";
            IDataReader dataReader3 = command3.ExecuteReader();

            while (dataReader3.Read())
            {
                int        int32      = dataReader3.GetInt32(0);
                Type       type1      = this.aKpdKBGUfP[dataReader3.GetInt32(1)];
                Type       type2      = this.BuYdCExFpF[dataReader3.GetInt32(2)];
                string     @string    = dataReader3.GetString(3);
                Instrument instrument = Activator.CreateInstance(type1, true) as Instrument;
                IPricer    pricer     = Activator.CreateInstance(type2) as IPricer;
                instrument.Symbol = @string;
                instrument.Id     = int32;
                instrument.Pricer = pricer;
                if (instrumentList[@string] == null)
                {
                    instrumentList.Add(instrument);
                }
            }
            dataReader3.Close();
            command3.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)instrumentList, "fsdfs");
            LegList    legList  = new LegList();
            IDbCommand command4 = this.connection.CreateCommand();

            command4.CommandText = "load";
            IDataReader dataReader4 = command4.ExecuteReader();

            while (dataReader4.Read())
            {
                int int32_1 = dataReader4.GetInt32(0);
                int int32_2 = dataReader4.GetInt32(1);
                int int32_3 = dataReader4.GetInt32(2);
                Leg leg     = new Leg(instrumentList.GetById(int32_3));
                leg.Id = int32_1;
                instrumentList.GetById(int32_2).Legs.Add((FIXGroup)leg);
                legList.Add((FIXGroup)leg);
            }
            dataReader4.Close();
            command4.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)legList, "");
            UnderlyingList underlyingList = new UnderlyingList();
            IDbCommand     command5       = this.connection.CreateCommand();

            command5.CommandText = "load";
            IDataReader dataReader5 = command5.ExecuteReader();

            while (dataReader5.Read())
            {
                int        int32_1    = dataReader5.GetInt32(0);
                int        int32_2    = dataReader5.GetInt32(1);
                int        int32_3    = dataReader5.GetInt32(2);
                Underlying underlying = new Underlying(instrumentList.GetById(int32_3));
                underlying.Id = int32_1;
                instrumentList.GetById(int32_2).Underlyings.Add((FIXGroup)underlying);
                underlyingList.Add((FIXGroup)underlying);
            }
            dataReader5.Close();
            command5.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)underlyingList, "dss");
            FIXSecurityAltIDGroupList securityAltIdGroupList = new FIXSecurityAltIDGroupList();
            IDbCommand command6 = this.connection.CreateCommand();

            command6.CommandText = "load";
            IDataReader dataReader6 = command6.ExecuteReader();

            while (dataReader6.Read())
            {
                int int32_1 = dataReader6.GetInt32(0);
                int int32_2 = dataReader6.GetInt32(1);
                FIXSecurityAltIDGroup securityAltIdGroup = new FIXSecurityAltIDGroup();
                securityAltIdGroup.Id = int32_1;
                instrumentList.GetById(int32_2).SecurityAltIDGroup.Add((FIXGroup)securityAltIdGroup);
                securityAltIdGroupList.Add((FIXGroup)securityAltIdGroup);
            }
            dataReader6.Close();
            command6.Dispose();
            FIXDbServer.LoadFIXGroups(this.connection, (FIXGroupList)securityAltIdGroupList, "fsfs");
            return(instrumentList);
        }
Beispiel #9
0
		public MarketManager() : base()
		{
			this.nxTAjlViDK = new Dictionary<Instrument, IMarketDataProvider>();
			this.utDAWNS3ic = new Dictionary<Instrument, IExecutionProvider>();
			this.cYRAR9UWJy = new InstrumentList();
		}
Beispiel #10
0
 public RoundTripArray GetOpenRoundTrips(InstrumentList instrumentList)
 {
   ArrayList array = new ArrayList();
   foreach (RoundTrip roundTrip in this.openRoundTrips)
   {
     if (instrumentList.Contains(roundTrip.Instrument))
       array.Add((object) roundTrip);
   }
   return new RoundTripArray(array);
 }