The return values for this API call returns the list of instruments but keeps on giving System.FormatException continuously. Anybody else faced with this problem?
Hi I am also using the Kite connect .Net API and have been facing the same issue. Exception thrown: 'System.FormatException' in mscorlib.dll String was not recognized as a valid DateTime. While enabling debug , I see all the instruments in the logs , however , the list of Instruments recieved from kite.GetInstruments() is missing several instruments such as basic ACC in NSE
Hi! I faced up with this issue too. The problem is into this code: TickSize = Convert.ToDecimal(data["tick_size"]); data["tick_size"] is a string, for example "0.25". It has '.' (dot) as separator, but my current system culture use ',' (comma) as separator. This is the reason of issue. When you parse the numbers with floating point, you should use CultureInfo.InvariantCulture My proposal is to use something like this: TickSize = Decimal.Parse(data["tick_Size"], CultureInfo.InvariantCulture);
Exception thrown: 'System.FormatException' in mscorlib.dll
String was not recognized as a valid DateTime.
While enabling debug , I see all the instruments in the logs , however , the list of Instruments recieved from kite.GetInstruments() is missing several instruments such as basic ACC in NSE
TickSize = Convert.ToDecimal(data["tick_size"]);
data["tick_size"] is a string, for example "0.25". It has '.' (dot) as separator, but my current system culture use ',' (comma) as separator. This is the reason of issue. When you parse the numbers with floating point, you should use
CultureInfo.InvariantCulture
My proposal is to use something like this:
TickSize = Decimal.Parse(data["tick_Size"], CultureInfo.InvariantCulture);
This also applies to LastPrice and Strike fields