コード例 #1
0
        private void Button_Buy(object sender, RoutedEventArgs e)
        {
            if (this.login == null)
            {
                return;
            }

            string tag = Guid.NewGuid().ToString().Replace("-", string.Empty);

            if (tag.Length > 8)
            {
                tag = tag.Substring(0, 8);
            }

            string payload = Payload.PlaceOrder("NSE", "RELIANCE", "BUY", "LIMIT", "MIS", 1, 1225.0d, 0.0d);

            this.orderId = Kite.Post <OrderId>(apiKey, login.access_token, KiteConnectAPI.Url.PlaceOrder(), payload, logger: this);
        }
コード例 #2
0
        private void OnLogin(string absoluteUri)
        {
            string requestToken, checkSum;

            if (!Kite.IsValidLogin(absoluteUri, apiKey, secret, out requestToken, out checkSum))
            {
                this.OnLog("********************* Failed to validate ***********************");
                return;
            }

            this.login = Kite.Post <Token>(string.Empty, string.Empty, KiteConnectAPI.Url.Token(), payload: Payload.Token(apiKey, requestToken, checkSum), logger: this);

            if (this.login == null)
            {
                this.OnLog("Failed to get access token");
                return;
            }

            this.SelectedTab = 1;
        }