How to get Continuous Data from .NET API Client ?

ashish_Innovantes
Hi, I want to get the Bids and Offers every second. I am using below code to access that but after some interval of 10-20 seconds. The documentation provided here https://github.com/zerodhatech/dotnetkiteconnect/tree/kite3 is not working especially Ticker instance is not calling . Please let me know the code I should use to access the Bids and Offers of ['NFO:NIFTY18JULFUT'] every second.

In the code below, I am using Timer and inside UpdatePanel a trigger is used to trigger the query after every second.

Code Used in aspx page -


asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ViewStateMode="Enabled">
Triggers>
asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
/Triggers>
ContentTemplate>
asp:Label ID="Label2" Visible="false" runat="server" Text="">
/ContentTemplate>
/asp:UpdatePanel>


in aspx.cs page -

protected void Timer1_Tick(object sender, EventArgs e)
{

kites.SetAccessToken(MyAccessToken);

if(MyAccessToken != "" || MyAccessToken != null)
{

DateTime date = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, INDIAN_ZONE);

string month = date.ToString("MMM").ToUpper();

Dictionary quotes = kites.GetQuote(InstrumentId: new string[] { "NFO:NIFTY18JULFUT" });

Label2.Text += System.Environment.NewLine + "Data = " + Utils.JsonSerialize(quotes) + System.Environment.NewLine;

}

}


please suggest me what to do because I have tried by creating a new Ticker instance as informed in GitHub Documentation but ticker is not getting called so if you can provide me a demo code it would be a great Help.

Thanks
Ashish
Sign In or Register to comment.