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; }
private void bg_MouseUp(object sender, MouseEventArgs e) { ptRelOfs = ptInvalid; ptMySize = ptInvalid; rsMouseX = RSMode.None; rsMouseY = RSMode.None; mdMouseAction = MDMode.None; }
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)); }
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, "", "", "")); }
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)); } }