Skip to content

Commit

Permalink
Merge pull request #58 from ranjanrak/bcd-ticker
Browse files Browse the repository at this point in the history
fix: add BCD price divisor for ticker
  • Loading branch information
vividvilla authored Oct 5, 2021
2 parents c03af37 + 9667ebb commit 8c83e37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ var KiteConnect = function(params) {
/**
* @memberOf KiteConnect
*/
self.EXCHANGE_BCD = "BCD";
/**
* @memberof KiteConnect
*/
self.EXCHANGE_BFO = "BFO";
/**
* @memberOf KiteConnect
Expand Down
8 changes: 7 additions & 1 deletion lib/ticker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8c83e37

Please sign in to comment.