Skip to content

Commit

Permalink
Futher restrict options-flow alerts to US equities, indices, and ETFs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed Apr 4, 2024
1 parent c187ac8 commit ba5ad7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/content/releases/4.19.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Bug Fixes**

* Updated the `AlertManager.filterPropertiesForSymbol` function to further limit options-flow properties (to US equities, indices, and ETFs).
* Updated the `AlertManager.filterTemplatesForSymbol` function to further limit options-flow properties (to US equities, indices, and ETFs).
4 changes: 2 additions & 2 deletions lib/AlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ module.exports = (() => {
}

if (valid && (property.property_id === 238 || property.property_id === 239)) {
valid = instrument.hasOptions && (instrument.symbolType === 1 || instrument.symbolType === 9);
valid = instrument.hasOptions && (instrument.symbolType === 1 || instrument.symbolType === 7 || instrument.symbolType === 9);
}

if (valid && is.number(target)) {
Expand Down Expand Up @@ -1234,7 +1234,7 @@ module.exports = (() => {
}

if (valid && properties.some(p => p === 238 || p === 239)) {
valid = instrument.hasOptions && (instrument.symbolType === 1 || instrument.symbolType === 9);
valid = instrument.hasOptions && (instrument.symbolType === 1 || instrument.symbolType === 7 || instrument.symbolType === 9);
}

return valid;
Expand Down
2 changes: 1 addition & 1 deletion lib/data/validators/instrument.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = (() => {
throw new Error(`${symbol} does not have options and cannot be used for option flow alerts`);
}

if ((property.property_id === 238 || property.property_id === 239) && !(instrument.symbolType === 1 || instrument.symbolType === 9)) {
if ((property.property_id === 238 || property.property_id === 239) && !(instrument.symbolType === 1 || instrument.symbolType === 7 || instrument.symbolType === 9)) {
throw new Error(`${symbol} does not support option flow alerts`);
}
}
Expand Down

0 comments on commit ba5ad7d

Please sign in to comment.