Exemplo n.º 1
0
 private void OnRtnDepthMarketData_Tick_callback(object sender, ref CTick pDepthMarketData)
 {
     try
     {
         OnRtnDepthMarketData_Tick(this, new OnTickArgs(ref pDepthMarketData));
     }
     catch (System.Exception)
     {
         Thread.Sleep(5);
         try
         {
             OnRtnDepthMarketData_Tick(this, new OnTickArgs(ref pDepthMarketData));
         }
         catch (System.Exception)
         {
             Thread.Sleep(5);
             try
             {
                 OnRtnDepthMarketData_Tick(this, new OnTickArgs(ref pDepthMarketData));
             }
             catch (System.Exception)
             {
                 Thread.Sleep(5);
                 try
                 {
                     OnRtnDepthMarketData_Tick(this, new OnTickArgs(ref pDepthMarketData));
                 }
                 catch (System.Exception)
                 {
                     //MessageBox.Show("MdApiWrapper::OnRtnDepthMarketData_Tick_callback:" + ex.ToString());
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private void OnRtnDepthMarketData_Tick(ref CTick pTick)
 {
     try
     {
         RtnDepthMarketData_Tick(this, new OnTickArgs(ref pTick));
     }
     catch (System.Exception ex)
     {
         Thread.Sleep(5);
         try
         {
             RtnDepthMarketData_Tick(this, new OnTickArgs(ref pTick));
         }
         catch (System.Exception)
         {
             Thread.Sleep(5);
             try
             {
                 RtnDepthMarketData_Tick(this, new OnTickArgs(ref pTick));
             }
             catch (System.Exception)
             {
                 Thread.Sleep(5);
                 try
                 {
                     RtnDepthMarketData_Tick(this, new OnTickArgs(ref pTick));
                 }
                 catch (System.Exception)
                 {
                     MessageBox.Show("MdApiWrapper::OnRtnDepthMarketData_Tick_callback:" + ex.ToString());
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Unicode;

            EventManager = new EventManager();
            TickThread   = new CTick();
            InputThread  = new VInput();

            //Starts the input manager thread
            InputThread.Start();

            //Start the ticks trigger thread
            TickThread.Start();


            //Starts a new game
            CGame.NewGame();

            string[] soundFile          = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic), "*.wav");
            System.Media.SoundPlayer sp = new System.Media.SoundPlayer();

            //Infinite loop for the game
            while (true)
            {
                foreach (string music in soundFile)
                {
                    sp.SoundLocation = music;
                    sp.PlaySync();
                }
            }
        }
Exemplo n.º 4
0
 private void OnHistoryTick_3(ref CTick pTick)
 {
     OnHistoryTick_1(this, ref pTick);
 }
Exemplo n.º 5
0
 private void OnRtnDepthMarketData_Tick_3(ref CTick pDepthMarketData_Tick)
 {
     OnRtnDepthMarketData_Tick_1(this, ref pDepthMarketData_Tick);
 }
Exemplo n.º 6
0
 public static void OnRtnDepthMarketData_Tick(ref CTick pTick)
 {
     Console.WriteLine("{0} {1}", pTick.InstrumentID, pTick.ExchangeTime);
 }
Exemplo n.º 7
0
 public OnTickArgs(ref CTick pTick)
 {
     this.pTick = pTick;
 }