Skip to content

Commit

Permalink
Release. Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsisk committed Apr 17, 2020
1 parent 4e7bac1 commit b0ddb69
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Barchart Market Data SDK <small>JavaScript 4.0.24</small>
# Barchart Market Data SDK <small>JavaScript 4.0.25</small>

> Inject real-time market data into your JavaScript applications
Expand Down
38 changes: 36 additions & 2 deletions example/browser/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ module.exports = (() => {

var handleEvents = function (data) {
if (data.event) {
debugger;
var event = data.event;

if (event === 'login success') {
Expand Down Expand Up @@ -4943,7 +4942,7 @@ module.exports = (() => {
'use strict';

return {
version: '4.0.24'
version: '4.0.25'
};
})();

Expand Down Expand Up @@ -6442,6 +6441,8 @@ module.exports = (() => {
types.futures.options.short = /^([A-Z][A-Z0-9\$\-!\.]?)([A-Z])([0-9]{1,4})([A-Z])$/i;
types.futures.options.long = /^([A-Z][A-Z0-9\$\-!\.]{0,2})([A-Z])([0-9]{1,4})\|(\-?[0-9]{1,5})(C|P)$/i;
types.futures.options.historical = /^([A-Z][A-Z0-9\$\-!\.]{0,2})([A-Z])([0-9]{2})([0-9]{1,5})(C|P)$/i;
types.equities = {};
types.equities.options = /^([A-Z\$][A-Z\.\-]{0,})([0-9]?)\|([[0-9]{4})([[0-9]{2})([[0-9]{2})\|([0-9]+\.[0-9]+)[P|W]?(C|P)/i;
types.indicies = {};
types.indicies.external = /^\$(.*)$/i;
types.indicies.sector = /^\-(.*)$/i;
Expand Down Expand Up @@ -6500,6 +6501,25 @@ module.exports = (() => {

return definition;
});
parsers.push(symbol => {
let definition = null;
const match = symbol.match(types.equities.options);

if (match !== null) {
definition = {};
definition.symbol = symbol;
definition.type = 'equity_option';
definition.option_type = match[7] === 'C' ? 'call' : 'put';
definition.strike = parseFloat(match[6]);
definition.root = match[1];
definition.month = parseInt(match[4]);
definition.day = parseInt(match[5]);
definition.year = parseInt(match[3]);
definition.adjusted = match[2] !== '';
}

return definition;
});
parsers.push(symbol => {
let definition = null;

Expand Down Expand Up @@ -6870,6 +6890,20 @@ module.exports = (() => {
static getIsBats(symbol) {
return is.string(symbol) && predicates.bats.test(symbol);
}
/**
* Returns true if the symbol represents an option on an equity or index; false
* otherwise.
*
* @public
* @static
* @param {String} symbol
* @returns {Boolean}
*/


static getIsEquityOption(symbol) {
return is.string(symbol) && types.equities.options.test(symbol);
}
/**
* Returns true if the symbol has an expiration and the symbol appears
* to be expired (e.g. a future for a past year).
Expand Down
2 changes: 1 addition & 1 deletion lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module.exports = (() => {
'use strict';

return {
version: '4.0.24'
version: '4.0.25'
};
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barchart/marketdata-api-js",
"version": "4.0.24",
"version": "4.0.25",
"description": "SDK for streaming market data from Barchart.com",
"author": {
"name": "Eero Pikat",
Expand Down

0 comments on commit b0ddb69

Please sign in to comment.