Skip to content

Commit

Permalink
Futher restrict options-flow alerts to US equities and US indices
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed Apr 4, 2024
1 parent 350284e commit be35240
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/content/releases/4.19.1.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 and US indices).
* Updated the `AlertManager.filterTemplatesForSymbol` function to further limit options-flow properties (to US equities and US indices).
2 changes: 1 addition & 1 deletion example/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ These scripts also illustrate:
```shell
node example.js --user_id=me
node example.js --user_id=me --mode=http
node example.js --user_id=me --host=localhost --port=3000
node example.js --user_id=me --host=localhost --port=3010
```
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;
valid = instrument.hasOptions && (instrument.symbolType === 1 || 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;
valid = instrument.hasOptions && (instrument.symbolType === 1 || instrument.symbolType === 9);
}

return valid;
Expand Down
4 changes: 4 additions & 0 deletions lib/data/validators/instrument.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module.exports = (() => {
if ((property.property_id === 238 || property.property_id === 239) && !instrument.hasOptions) {
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)) {
throw new Error(`${symbol} does not support option flow alerts`);
}
}
}
};
Expand Down

0 comments on commit be35240

Please sign in to comment.