Place Order Issue

sudhioyoor
I am trying to Place an order using Vb.net with kiteconnect.dll . but it not working . my code mentioned below ,
Kindly help me to solve this problem ,

like ( kite.GetInstruments(), kite.GetHoldings() ) working fine


Private Sub txtOrder_Click(sender As Object, e As EventArgs) Handles txtOrder.Click
Dim user As User = kite.RequestAccessToken(RequestToken, MySecret)
Dim MyAccessToken As String = user.AccessToken
Dim MyPublicToken As String = user.PublicToken
kite.SetAccessToken(MyAccessToken)
MsgBox(MyAccessToken)

kite.PlaceOrder("NSE", "ASHOKLEY", "BUY", "day", "1", "MIS", "CNC")


End Sub

please help me
  • tonystark
    Can you post the error message you are getting back to PlaceOrder function? You can also provide Debug param as True while you create a new object of Kite. This will print more debug information to console.
  • sudhioyoor
    thanks Tonystark for your response.

    Debug already in True condition

    i got these type of information in my console window

    A first chance exception of type 'System.EntryPointNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.Net.WebException' occurred in System.dll
    A first chance exception of type 'System.Net.WebException' occurred in System.dll
  • tonystark
    tonystark edited December 2017
    PlaceOrder function signature goes like:
    kite.PlaceOrder(Exchange, TradingSymbol, TransactionType, Quantity, Price, Product...)
    Your order of parameters is wrong. Optionally to reduce mistakes you can specify parameters with their names like:

    kite.PlaceOrder("CDS", "USDINR17AUGFUT", "BUY", "1", Price: "63.9000", OrderType: "LIMIT", Product: "NRML");
    You can find more examples here.
  • sudhioyoor
    Dear TonyStark

    Thanks for your Help.
    My problem solved .

    Here is my New code :

    Dim kite As New Kite(MyAPIKey, Debug:=True)
    Dim user As User = kite.RequestAccessToken(RequestToken, MySecret)
    Dim MyAccessToken As String = user.AccessToken
    Dim MyPublicToken As String = user.PublicToken
    kite.SetAccessToken(MyAccessToken)
    txtAcess.Text = MyAccessToken
    Dim res As Dictionary(Of String, Object)
    res = kite.PlaceOrder("NSE", "INFY", "BUY", "100", Product:="MIS", OrderType:="MARKET")
    res.ToList()
    dgv1.DataSource = res.ToList
This discussion has been closed.