Esempio n. 1
0
        private async void buttonGetAssetD_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }

            try
            {
                comboBoxMktSym.Items.Clear();

                var client = new RESTClient4Market(comboBoxMktServer.Text);
                var ret    = await client.GetAssetDAsync();

                LOG($"[GetAssetD] <<");
                foreach (var item in ret)
                {
                    comboBoxMktSym.Items.Add(item.Sym);
                    LOG($"{Helper.MyJsonMarshal(item)}\r\n");
                }
                LOG($"========\r\n");

                if (comboBoxMktSym.Items.Count > 0)
                {
                    comboBoxMktSym.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }
Esempio n. 2
0
        private async void buttonGetServerInfo_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }
            try
            {
                var client = new RESTClient4Market(comboBoxMktServer.Text);
                var ret    = await client.GetServerInfoAsync();

                LOG($"[ServerInfo] << {Helper.MyJsonMarshal(ret)} \r\n");
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }
Esempio n. 3
0
        private async void buttonGetTime_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }
            try
            {
                var client = new RESTClient4Market(comboBoxMktServer.Text);
                var delta  = await client.GetTimeAsync();

                LOG($"[Time]<< time delta(ms): {delta}\r\n");
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }
Esempio n. 4
0
        private async void buttonGetKLineIdx_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }
            if (comboBoxMktIndex.Text.Length < 1)
            {
                return;
            }

            Gmex.API.Models.MktKLineType typ;
            int beginSec, offset, count;

            try
            {
                beginSec = Convert.ToInt32(textBoxBeginSecIdx.Text.Trim());
                offset   = Convert.ToInt32(textBoxOffsetIdx.Text.Trim());
                count    = Convert.ToInt32(textBoxCountIdx.Text.Trim());
                typ      = (Gmex.API.Models.MktKLineType)(comboBoxMktKLineTypIdx.SelectedIndex + 1);
            }
            catch (Exception)
            {
                return;
            }

            try
            {
                var client = new RESTClient4Market(comboBoxMktServer.Text);
                var ret    = await client.GetHistKLineAsync(comboBoxMktIndex.Text, typ, beginSec, offset, count);

                LOG($"[GetHistKLine] << {Helper.MyJsonMarshal(ret)} \r\n");
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }
Esempio n. 5
0
        private async void buttonGetOrd20_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }
            if (comboBoxMktSym.Text.Length < 1)
            {
                return;
            }

            try
            {
                var client = new RESTClient4Market(comboBoxMktServer.Text, Convert.ToInt32(textBoxVPID.Text));
                var ret    = await client.GetOrd20Async(comboBoxMktSym.Text);

                LOG($"[GetOrd20] << {Helper.MyJsonMarshal(ret)} \r\n");
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }
Esempio n. 6
0
        private async void buttonGetAssetEx_ClickAsync(object sender, EventArgs e)
        {
            if (comboBoxMktServer.Text.Length < 4)
            {
                return;
            }

            try
            {
                var client = new RESTClient4Market(comboBoxMktServer.Text);
                var ret    = await client.GetAssetExAsync();

                LOG($"[GetAssetEx] <<");
                foreach (var item in ret)
                {
                    LOG($"{Helper.MyJsonMarshal(item)}\r\n");
                }
                LOG($"========\r\n");
            }
            catch (Exception ex)
            {
                LOG("[ERROR] Exception: " + ex.Message + "\r\n");
            }
        }