Skip to content

Jib.reqMktData throws e = TypeError: in typeassert, expected Float64, got a value of type Nothing #16

Description

Hi there
remember I am a noob so please bear with me.I am trying not to bother you.

I added a 10 sec sleep and made the method override to see how it works but I got an error I don't know how to diagnose. I am running all of this in the repl and text editor.

ALSO I feel bad about raising these things as issues, do you have a julia discourse thread please?

using Jib
symbols = ["AAPL", "TSLA", "AMD", "INTC"]


ib = Jib.connect("192.168.1.219",1234, 21)

d, wrap = Jib.simple_wrap();

wrap.tickPrice = (tickerId, field, price, size, attrib) -> println("tickPrice2: $(symbols[tickerId]) $field $price $size $attrib")

Jib.start_reader(ib, wrap)

for (idx, s) in enumerate(symbols)
  contract = Jib.Contract(symbol=s, secType="STK", exchange="SMART", currency="USD")
  Jib.reqMktData(ib, idx, contract, "", false)
end

sleep(10)

for idx in 1:length(symbols)
  Jib.cancelMktData(ib, idx)
end

Jib.disconnect(ib)

and got this error

 Info: connected
│   V = "165"
└   T = "20220207 13:44:45 Central Standard Time"
error: -1 2104 Market data farm connection is OK:uscrypto 
error: -1 2104 Market data farm connection is OK:usfuture.nj 
error: -1 2104 Market data farm connection is OK:usfarm.nj 
error: -1 2104 Market data farm connection is OK:usfuture 
error: -1 2104 Market data farm connection is OK:cashfarm 
error: -1 2104 Market data farm connection is OK:usopt 
error: -1 2104 Market data farm connection is OK:usfarm 
error: -1 2106 HMDS data farm connection is OK:ushmds.nj 
error: -1 2106 HMDS data farm connection is OK:ushmds 
error: -1 2158 Sec-def data farm connection is OK:secdefil 
marketDataType: 1 REALTIME
tickReqParams: 1 0.01 9c0001 3
tickString: 1 LAST_TIMESTAMP 1644263088
tickString: 1 LAST_EXCH Q
tickPrice2: AAPL LAST 172.81 1.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickSize: 1 LAST_SIZE 1.0
tickSize: 1 VOLUME 519927.0
tickPrice2: AAPL HIGH 173.95 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL LOW 171.53 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL CLOSE 172.39 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL OPEN 172.76 0.0 (canAutoExecute = false, pastLimit = false, preOpen = false)
tickPrice2: AAPL BID 172.8 23.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickPrice2: AAPL ASK 172.81 33.0 (canAutoExecute = true, pastLimit = false, preOpen = false)
tickSize: 1 BID_SIZE 23.0
tickSize: 1 ASK_SIZE 33.0
tickString: 1 BID_EXCH KPQXZU
tickString: 1 ASK_EXCH KPQZNU
marketDataType: 2 REALTIME
tickReqParams: 2 0.01 9c0001 3
┌ Error: exception thrown
│   e = TypeError: in typeassert, expected Float64, got a value of type Nothing
└ @ Jib.Reader ~/.julia/packages/Jib/SeCxV/src/reader.jl:74
[ Info: reader exiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions