Coder Social home page Coder Social logo

Can't send order to TWS about ib HOT 10 CLOSED

stoqey avatar stoqey commented on August 16, 2024
Can't send order to TWS

from ib.

Comments (10)

ceddybi avatar ceddybi commented on August 16, 2024

@vitsy thank you so much for reporting this Victor, I'll cc @mfrener our lead on the newer version to check it out, in the meantime feel free to use the earlier version, please don't hesitate to share a fix in case you run into it.

from ib.

mfrener avatar mfrener commented on August 16, 2024

OMG... there was no strict="true" on the tsconfig, but did rely on that it is there w/o actually checking..
Result is about a ton of un-checked optional chains. Have added strict="true" to and fixed all the new compile errors, including the:
tokens.push(order.softDollarTier.name)
--> should be:
tokens.push(order.softDollarTier?.name ? order.softDollarTier.name: ""), so undefined softDollarTier will translate to empty token.

There is a PR open #18, however I will not be able to actually test it before ~Wednesday.

@vitsy if you want test fix already you can do so:
Checkout https://github.com/stoqey/ib/tree/bugfix/issue-16 branch, do "npm run build" and update your node_modules/@stoqey/ib folder with /dist folder as generted by the npm build (see https://github.com/stoqey/ib/wiki/Developer-Guide how to build).

from ib.

vitsy avatar vitsy commented on August 16, 2024

Great!
Your pull request is solve this problem,
But i got error in the decoder .
at Decoder.decodeMsg_TICK_PRICE (/media/victor/DOG/Charting/Optimizer/server/node_modules/@stoqey/ib/src/io/decoder.ts:347:24)
I will check more later.
Thanks!
Victor

from ib.

mfrener avatar mfrener commented on August 16, 2024

Hmm that is strange, I'm using reqMktData / EventName.tickePrice on my own already and did had no problem so far. Let me know if you have any more info.
If you want to cross-check: the official reference code from IB we use right now is https://github.com/stoqey/ib/blob/master/ref/client/EDecoder.java - our decodeMsg_TICK_PRICE must do same as their private void processTickPriceMsg(), but in TS rather than Java.

from ib.

vitsy avatar vitsy commented on August 16, 2024

from ib.

mfrener avatar mfrener commented on August 16, 2024

Hey Victor.

In general, a value of 1.7976931348623157e+308 (= Number.MAX_VALUE) on tick values means that this values is not available right now. Can have multiple reasons, i.e. you are outside trading-hours and have request real-time, but not the frozen data (see https://stoqey.github.io/ib-doc/classes/ibapi.html#reqmarketdatatype), or you don't have market data for it all, or... many reason.

So if you get Number.MAX_VALUE value on any of the events (such as tickPrice, tickSize, tickOptionComputation, pnl, ...) is means this value is not available from IB right now.
If you can see that value on TWS but not via API, cross check https://stoqey.github.io/ib-doc/classes/ibapi.html#reqmarketdatatype

from ib.

vitsy avatar vitsy commented on August 16, 2024

from ib.

mfrener avatar mfrener commented on August 16, 2024

Ok  you right, but suppose that better when this situation can be proccesed inside your API  ( as far decoder.ts  is inner part of API) I mean that decoder must continue work. But in any case thanks! Suppose that my issue can be closed   Thanks, Victor  
Воскресенье, 24 января 2021, 16:11 +03:00 от Matthias Frener @.***>:     Hey Victor. In general, a value of 1.7976931348623157e+308 (= Number.MAX_VALUE) on tick values means that this values is not available right now. Can have multiple reasons, i.e. you are outside trading-hours and have request real-time, but not the frozen data (see https://stoqey.github.io/ib-doc/classes/ibapi.html#reqmarketdatatype ), or you don't have market data for it all, or... many reason. So if you get Number.MAX_VALUE value on any of the events (such as tickPrice, tickSize, tickOptionComputation, pnl, ...) is means this value is not available from IB right now. If you can see that value on TWS but on via API, cross check https://stoqey.github.io/ib-doc/classes/ibapi.html#reqmarketdatatype — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or unsubscribe .
    -- Виктор Цыба

I was also thinking about doing some special handling inside the decoder for that, i.e. use number|undefined types and return undefined instead of Number.MAX_VALUE... but this would diverge from official IB API.
On the IB TWS Java API they use Double.MAX_VALUE, we use Number.MAX_VALUE in our TypeScript clone. So Java and are TS APIs is in sync, also if there would be better solutions for 'not available values' in TS.

Thanks for feedback & testing - waiting for PR review than it will be merged to master.

from ib.

mfrener avatar mfrener commented on August 16, 2024

PR is merged to master, npm update will follow soon.
Thanks for reporting!

from ib.

vitsy avatar vitsy commented on August 16, 2024

from ib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.