コード例 #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());
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: MdWrapper.cs プロジェクト: zhuzhenping/CTP-MATLAB
 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());
                 }
             }
         }
     }
 }
コード例 #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();
                }
            }
        }
コード例 #4
0
 private void OnHistoryTick_3(ref CTick pTick)
 {
     OnHistoryTick_1(this, ref pTick);
 }
コード例 #5
0
 private void OnRtnDepthMarketData_Tick_3(ref CTick pDepthMarketData_Tick)
 {
     OnRtnDepthMarketData_Tick_1(this, ref pDepthMarketData_Tick);
 }
コード例 #6
0
 public static void OnRtnDepthMarketData_Tick(ref CTick pTick)
 {
     Console.WriteLine("{0} {1}", pTick.InstrumentID, pTick.ExchangeTime);
 }
コード例 #7
0
 public OnTickArgs(ref CTick pTick)
 {
     this.pTick = pTick;
 }