C# Windows application to link this kite api client

Gopalakrishnanbalraj
Hi All,

I am new to this api. I have created my own window C# application, where i am doing some trading manipulation with my strategy. Hence i always copy the entry price, SL and target from that tool to PI to make an order. Hence i feel its taking time while trading. So that i want to make a order directly from my windows C# application.

I need functionalities like place BO order and modify BO and Cancel BO.

Please help me by providing some tips.

Thanks.
  • botany02
    botany02 edited November 2016
    @Gopalakrishnanbalraj

    Try this http://www.howutrade.in/docs/kitedotnet/
    or
    http://www.howutrade.in/docs/kiteXL

    You can Simply Call the Kite.PlaceBO (
    Exch As String,
    TrdSym As String,
    Trans As String,
    Qty As Integer,
    LmtPrice As Double,
    SqOffValue As Double,
    StoplossValue As Double,
    Optional TrailValue As Double = 0
    ) As String

    To Place BO

    Sample App @ http://www.howutrade.in/docs/kitedotnet/html/SampleKite.zip
  • Gopalakrishnanbalraj
    Gopalakrishnanbalraj edited November 2016
    @botany02
    @sujith
    Thanks a lot. But whatever references you have given is with vb.net. Do you have any references for c#.

    And as a first step what i have to do. whether i have to create a app to get an api key to use this feature?

    Thanks in Advance
  • botany02
    botany02 edited November 2016
    @Gopalakrishnanbalraj
    The Sample Project is vb.net, But you can simply port it to C#
    Api Key & Api Seceret is must to connect to Kite.trade

    Just Follow the below Steps.
    1.Signup for Kite Developer a/c
    2.Create app in Developer a/c
    3.Now you have api key & api secret

    4.download the KiteDotnet dll & dependencies @ http://www.howutrade.in/docs/kitedotnet/html/KiteDotNet.zip
    5.Copy the all the dll files to your project debug folder
    6.Goto Project Properties add reference to KiteDotNet.dll only

    7.Now you can call all methods of KiteDotNet.dll from your C# App by Importing KiteDotNet

    Example:-
    Add a Windows Form
    Add Two Button to your app (One For Login, One For Placing BO)

    using KiteDotNet;

    public class Form1
    {
    //Initialize
    Kite Kite = new Kite();
    private void Button1_Click(object sender, EventArgs e)
    {
    Kite.Api_Key = "Your API Key";

    Kite.Api_Secret = "Your API Secret";

    Kite.Stream_Mode = Mode.Full;

    try {
    //below will Login

    Kite.Login();
    Kite.GetAccessToken();
    Kite.GetInstruments();


    } catch (Exception ex) {
    Interaction.MsgBox(ex.Message);
    }

    }


    private void Button2_Click(object sender, EventArgs e)
    {
    try {
    //This will place Bracket Order
    string OrderId = Kite.PlaceBO("NSE", "AXISBANK" "BUY", 1, 450.55, 2.1,2.1,1);
    Interaction.MsgBox("Order Placed Successfully. OrderId is " + OrderId);
    } catch (Exception ex) {
    Interaction.MsgBox(ex.Message);
    }
    }
    }

    You Just need to add reference to KiteDotNet.dll & call the respective methods
    The above is the Just sample,
    Refer the help Doc for complete methods & properties supported
    http://www.howutrade.in/docs/kitedotnet/
    If You are Pro or Intermediate, then You can build the entire platform in 1hr.
    But if you are beginner, then you need to study lot of things
  • Gopalakrishnanbalraj
    @botany02

    It is a great solution . thanks a lot buddy. :smile:
  • botany02
    @Gopalakrishnanbalraj

    Welcome...!

    You can also Try the KiteXL....
  • deco
    Sir
    When I use KiteXL Can I use code given below (inC#)
    using KiteXL;

    public class Form1
    {
    //Initialize
    KiteXL KiteXL = new KiteXL();
    Decosta
  • botany02
    @deco

    You can use KiteXL in C# , But it doesn't have Events for Streaming Quotes,instead uses RTD server.
    So you need to implement RTD client in C#, but it is complex.

    Better use, KiteDotNet and it has everything.
  • deco
    thank you sir for your replay
    The charting software I use has RTD pluggine and as their API is not public It is not easy to feed streaming quote to it.Their RTD plugin is working and I had used it with truedata feeds.
    My doubt is whether following code is correct
    KiteXL KiteXL = new KiteXL();
    Expecting your valued opinion
    Decosta
  • botany02
    @deco

    Yes, It should work, just import KiteXL to your project.
    You can create instance of KiteXL using New KiteXL.
  • deco
    one more question
    Does kitedotnet has rtd server ?
  • botany02
    @deco

    KiteDotNet doesn't support RTD.
  • paragsatpute
    @botany02
    Can we use KiteDotNet with NinjaTrader 8?
    Please can you help me somehow in understanding how can we get started with it?
Sign In or Register to comment.