It looks like you're new here. If you want to get involved, click one of these buttons!
/// <summary>
/// Retrieve LTP and OHLC of upto 200 instruments
/// </summary>
/// <param name="Exchange">Name of the exchange</param>
/// <param name="TradingSymbol">Tradingsymbol of the instrument</param>
/// <returns>Json response in the form of nested string dictionary.</returns>
try
{
Dictionary<string, OHLC> ohlcs = kite.GetOHLC(new string[] { "MCX:ALUMINI17NOVFUT","MCX:ALUMINIUM17NOVFUT","MCX:COPPER17NOVFUT","MCX:COPPERM17NOVFUT","MCX:COTTONREF17NOVFUT","MCX:CPO17NOVFUT","MCX:GOLDGUINEA17NOVFUT","MCX:GOLDPETAL17NOVFUT","MCX:LEAD17NOVFUT","MCX:LEADMINI17NOVFUT","MCX:MENTHAOIL17NOVFUT","MCX:NICKEL17NOVFUT","MCX:NICKELM17NOVFUT","MCX:RBDPMOLEIN17NOVFUT","MCX:SILVER100017NOVFUT","MCX:SILVERM17NOVFUT","MCX:SILVERMIC17NOVFUT","MCX:ZINC17NOVFUT","MCX:ZINCMINI17NOVFUT" });
Console.WriteLine(JsonSerialize(ohlcs));
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
//// Get LTP of upto 200 scrips
/// <summary>
/// Retrieve LTP of upto 200 instruments
/// </summary>
/// <param name="Exchange">Name of the exchange</param>
/// <param name="TradingSymbol">Tradingsymbol of the instrument</param>
/// <returns>Json response in the form of nested string dictionary.</returns>
try
{
Dictionary<string, LTP> ltps = kite.GetLTP(new string[] { "MCX:ALUMINI17NOVFUT", "MCX:ALUMINIUM17NOVFUT", "MCX:COPPER17NOVFUT", "MCX:COPPERM17NOVFUT", "MCX:COTTONREF17NOVFUT", "MCX:CPO17NOVFUT", "MCX:GOLDGUINEA17NOVFUT", "MCX:GOLDPETAL17NOVFUT", "MCX:LEAD17NOVFUT", "MCX:LEADMINI17NOVFUT", "MCX:MENTHAOIL17NOVFUT", "MCX:NICKEL17NOVFUT", "MCX:NICKELM17NOVFUT", "MCX:RBDPMOLEIN17NOVFUT", "MCX:SILVER100017NOVFUT", "MCX:SILVERM17NOVFUT", "MCX:SILVERMIC17NOVFUT", "MCX:ZINC17NOVFUT", "MCX:ZINCMINI17NOVFUT" });
Console.WriteLine(JsonSerialize(ltps));
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
I received an error.
You are correct. The RBDPMOLEIN is the culprit. I just want to know, is there any reason behind using the Trading Symbols along with Exchange instead of Instrument Token.
I believe it will be good for programmers to use the same kind of standards over the project.
Thanks & Regards,
R C Vamsi Vardhan