private void Trading(string[] st) { using (ConnectKHOpenAPI api = new ConnectKHOpenAPI(new FreeVersion(), new SpecifyKospi200 { Stop = IStopLossAndRevenue.StopLossAndRevenue.UnUsed, BasicAssets = 35000000, Division = false, Reaction = int.Parse(st[0]), ShortMinPeriod = int.Parse(st[1]), ShortDayPeriod = int.Parse(st[2]), LongMinPeriod = int.Parse(st[3]), LongDayPeriod = int.Parse(st[4]), ShortTickPeriod = 5, LongTickPeriod = 60, Strategy = string.Concat(st[0], ".", st[1], ".", st[2], ".", st[3], ".", st[4]) })) { ConfirmOrder cf = ConfirmOrder.Get(); panel.Controls.Add(api); panel.Controls.Add(cf); Location = new Point(2, 1000); StartPosition = FormStartPosition.Manual; Size = cf.Size; Opacity = 0.65; cf.Dock = DockStyle.Fill; cf.BackColor = Color.FromArgb(203, 212, 206); api.Dock = DockStyle.Fill; api.Hide(); api.SendQuit += OnReceiveDialogClose; ShowDialog(); } Dispose(); Environment.Exit(0); }
private void Trading(string[] st) { using (ConnectKHOpenAPI api = new ConnectKHOpenAPI(new FreeVersion(), new SpecifyKosdaq150 { Stop = IStopLossAndRevenue.StopLossAndRevenue.UnUsed, BasicAssets = 5000000, Division = false, Reaction = int.Parse(st[0]), ShortMinPeriod = int.Parse(st[1]), ShortDayPeriod = int.Parse(st[2]), LongMinPeriod = int.Parse(st[3]), LongDayPeriod = int.Parse(st[4]), ShortTickPeriod = 5, LongTickPeriod = 60, Strategy = string.Concat(st[0], ".", st[1], ".", st[2], ".", st[3], ".", st[4]) })) { ConfirmOrder cf = ConfirmOrder.Get(); webBrowser.Show(); tableLayoutPanel.RowStyles.Clear(); tableLayoutPanel.Controls.Add(webBrowser, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 70))); tableLayoutPanel.Controls.Add(panel, 0, tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 50))); panel.Controls.Add(api); panel.Controls.Add(cf); cf.Dock = DockStyle.Fill; api.Dock = DockStyle.Fill; api.Hide(); panel.BorderStyle = BorderStyle.None; WindowState = FormWindowState.Maximized; api.SendQuit += OnReceiveDialogClose; ShowDialog(); } Dispose(); Environment.Exit(0); }
private void OnReceiveClose(object sender, DialogClose e) { SuspendLayout(); StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI()); strategy = new Strategy(new Specify { Reaction = e.Reaction, ShortDayPeriod = e.ShortDay, ShortTickPeriod = e.ShortTick, LongDayPeriod = e.LongDay, LongTickPeriod = e.LongTick, HedgeType = e.Hedge }); }
private void OnReceiveClose(object sender, DialogClose e) { SuspendLayout(); StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI()); BeginInvoke(new Action(() => Strategy = new Strategy(new Specify { Reaction = e.Reaction, ShortDayPeriod = e.ShortDay, ShortTickPeriod = e.ShortTick, LongDayPeriod = e.LongDay, LongTickPeriod = e.LongTick, HedgeType = e.Hedge, Base = e.Base, Sigma = e.Sigma, Percent = e.Percent, Max = e.Max, Quantity = e.Quantity, Time = e.Time }))); }
private void OnReceiveClose(object sender, DialogClose e) { SuspendLayout(); StartTrading(Balance.Get(), ConfirmOrder.Get(), new AccountSelection(), new ConnectKHOpenAPI()); result = BeginInvoke(new Action(() => { strategy = new Strategy(new Specify { Reaction = e.Reaction, ShortDayPeriod = e.ShortDay, ShortTickPeriod = e.ShortTick, LongDayPeriod = e.LongDay, LongTickPeriod = e.LongTick, HedgeType = e.Hedge }); })); do { Application.DoEvents(); }while (result.IsCompleted == false); }