-
Have added contractDetails and contractDetailsEnd to Wrap. I am trying to fill out the contract with the current ES contract using reqContractDetails to get the latest contract as reqMktData doesn't allow "CONTFUT" . I want to replicate what I see on the TWS desktop watchlist and the below is the workaround. It will work in python but not in MY (noob) julia code, so I'm trying to figure out where I am going wrong. Any help would be appreciated.
but I'm getting these errors. Note the reqContractDetails seems to work. I am calling for both ES and CL.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
It's not clear how you define the contracts. Jib.reqMktData(ib, 1, Jib.Contract(conId=461318816, exchange="GLOBEX"), "", false)
Jib.reqMktData(ib, 2, Jib.Contract(conId=256019299, exchange="NYMEX"), "", false) |
Beta Was this translation helpful? Give feedback.
-
It's not clear what Anyway, in the following pattern: for (idx, s) in ...
contract = Jib.Contract(...)
Jib.reqContractDetails(ib, idx, contract)
Jib.reqMktData(ib, idx, contract, "", false)
end there is only one Also, the communication with TWS happens asynchronously, i.e.: In the code above, You might want to revisit this example as a template on how to feed data from TWS responses into the main program. |
Beta Was this translation helpful? Give feedback.
-
Hi there the intent of the loop ( in pseudocode below) is to get the current front month for a future and get a stream of data for it going.
that's what I was trying to do in my wrap
and it "seemed" to work in principal using vscode. so my intent was to create the call to reqMktData but for ONLY the front month. I "think" I see what might be happening thanks to your explanation. I didn't account for the asynch so maybe if I waited for the contractDetailsEnd callback before the call to reqMktData? |
Beta Was this translation helpful? Give feedback.
It's not clear what
Wrap.contractDetails()
does exactly in this example.Anyway, in the following pattern:
there is only one
contract
and it is fed to bothreqContractDetails()
andreqMktData()
.reqContractDetails()
doesn't return anything and doesn't change its arguments nor any sorrounding variables.Also, the communication with TWS happens asynchronously, i.e.:
Wrap.contractDetails()
is called only when TWS responses are received and you don't have any control on when, if or how many times it is ever executed.If it is indeed executed t…