From 9667ebb22c80865a48fb82e5bdfbf457b8b43624 Mon Sep 17 00:00:00 2001 From: Rakesh R Date: Mon, 27 Sep 2021 12:00:51 +0530 Subject: [PATCH] fix: add bcd divisor for ticker --- lib/connect.js | 4 ++++ lib/ticker.js | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/connect.js b/lib/connect.js index ab8e8a5..645cd26 100644 --- a/lib/connect.js +++ b/lib/connect.js @@ -318,6 +318,10 @@ var KiteConnect = function(params) { /** * @memberOf KiteConnect */ + self.EXCHANGE_BCD = "BCD"; + /** + * @memberof KiteConnect + */ self.EXCHANGE_BFO = "BFO"; /** * @memberOf KiteConnect diff --git a/lib/ticker.js b/lib/ticker.js index d5dec82..10d5a88 100644 --- a/lib/ticker.js +++ b/lib/ticker.js @@ -503,8 +503,14 @@ var KiteTicker = function(params) { var tradable = true; if (segment === Indices) tradable = false; + // Add price divisor based on segment var divisor = 100.0; - if (segment === NseCD) divisor = 10000000.0; + if (segment === NseCD) { + divisor = 10000000.0; + + } else if (segment == BseCD) { + divisor = 10000.0; + } // Parse LTP if (bin.byteLength === 8) {