Skip to content

Commit

Permalink
tickOptionComputation bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed Dec 31, 2024
1 parent 492d9e2 commit 60e8b20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions eslint.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "@smarttools/eslint-plugin-rxjs";
6 changes: 4 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ export default tseslint.config(
varsIgnorePattern: "^_",
},
],

quotes: ["error", "double"],
semi: ["error", "always"],
strict: "error",

"rxjs/no-async-subscribe": "error",
"rxjs/no-ignored-observable": "error",
"rxjs/no-ignored-subscription": "error",
"rxjs/no-unbound-methods": "error",
"rxjs/throw-error": "error",
semi: ["error", "always"],
strict: "error",
},
},
{
Expand Down
14 changes: 7 additions & 7 deletions src/core/io/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1593,17 +1593,17 @@ export class Decoder {
* Decode a TICK_OPTION_COMPUTATION message from data queue and emit a tickOptionComputation event.
*/
private decodeMsg_TICK_OPTION_COMPUTATION(): void {
let version;
if (this.serverVersion >= MIN_SERVER_VER.PRICE_BASED_VOLATILITY)
version = Number.MAX_VALUE;
else version = this.readInt();
const version =
this.serverVersion >= MIN_SERVER_VER.PRICE_BASED_VOLATILITY
? Number.MAX_VALUE
: this.readInt();

const tickerId = this.readInt();
const tickType = this.readInt();

let tickAttrib = Number.MAX_VALUE;
let _tickAttrib;
if (this.serverVersion >= MIN_SERVER_VER.PRICE_BASED_VOLATILITY) {
tickAttrib = this.readInt();
_tickAttrib = this.readInt();
}

let impliedVol = this.readDouble();
Expand Down Expand Up @@ -1673,7 +1673,7 @@ export class Decoder {
EventName.tickOptionComputation,
tickerId,
tickType,
tickAttrib,
// tickAttrib, 0 - return based, 1- price based. Ignored
impliedVol,
delta,
optPrice,
Expand Down

0 comments on commit 60e8b20

Please sign in to comment.