コード例 #1
0
        private void bg_MouseDown(object sender, MouseEventArgs e)
        {
            double dX = this.Width / 10.0;
            double dY = this.Height / 10.0;

            if (e.X < dX * 1)
            {
                rsMouseX = RSMode.Left;
            }
            if (e.X > dX * 9)
            {
                rsMouseX = RSMode.Right;
            }
            if (e.Y < dY * 1)
            {
                rsMouseY = RSMode.Up;
            }
            if (e.Y > dY * 9)
            {
                rsMouseY = RSMode.Down;
            }
            if (rsMouseX != RSMode.None ||
                rsMouseY != RSMode.None)
            {
                mdMouseAction = MDMode.Resize;
            }
            else
            {
                mdMouseAction = MDMode.Move;
            }
            ptMySize = (Point)this.Size;
            ptRelOfs = e.Location;
        }
コード例 #2
0
 private void bg_MouseUp(object sender, MouseEventArgs e)
 {
     ptRelOfs      = ptInvalid;
     ptMySize      = ptInvalid;
     rsMouseX      = RSMode.None;
     rsMouseY      = RSMode.None;
     mdMouseAction = MDMode.None;
 }
コード例 #3
0
        public int InitEx(string username, string password, MDMode mode = MDMode.MD_MODE_NULL, string subscribe_symbols = "", string start_time = "", string end_time = "", string rest_addr = "", string live_addr = "", string gm_addr = "")
        {
            int num = NativeMethods.gm_login(username, password, gm_addr);

            if (num != 0)
            {
                return(num);
            }
            return(NativeMethods.gm_md_init_ex((int)mode, subscribe_symbols, start_time, end_time, rest_addr, live_addr));
        }
コード例 #4
0
 public int Init(string username, string password, MDMode mode = MDMode.MD_MODE_NULL, string subscribe_symbols = "", string start_time = "", string end_time = "")
 {
     return(this.InitEx(username, password, mode, subscribe_symbols, start_time, end_time, "", "", ""));
 }
コード例 #5
0
ファイル: MyStrategy.cs プロジェクト: jiangyimin/QTP
        private void InitGM()
        {
            // MDMode
            if (RunType == "实盘" || RunType == "虚拟")
            {
                mdmode = MDMode.MD_MODE_LIVE;  //MDMode.MD_MODE_SIMULATED;
            }

            // Subscrible Instruments
            StringBuilder sb = new StringBuilder();
            foreach (Monitor m in this.GetMonitorEnumerator())
            {
                if (mdmode == MDMode.MD_MODE_LIVE || mdmode == MDMode.MD_MODE_SIMULATED)
                    sb.Append(m.Target.Symbol + ".tick,");

                foreach (int period in TAInfo.Periods)
                    sb.Append(string.Format("{0}.bar.{1},", m.Target.Symbol, period * 60));         // 按s
            }

            int ret = base.Init(gmLogin.UserName, gmLogin.Password, strategyT.GMID, sb.ToString(), mdmode, "localhost:8001");
            if (ret != 0)
            {
                InitializeExceptionOccur(string.Format("初始化掘金错误{0}", ret));
            }
        }