|
down vote[favorite](“http://stackoverflow.com/questions/38832447/tickperplant-subscription-by-sym#” "“Click”)
|
I have a ticker plant that has the schema:
quote:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())trade:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())rfills:([]time:();sym:();expiration:();tag:();price:();volume:())
I then double check the schema by doing
meta trade
!["table]()
I subscribe to the tickerplant as such getting the trade table
h(`.u.sub;`trade;`)
But when I try to specify a symbol from sym by doing
h(`.u.sub;`trade;`ZB)
No records are being pushed, This is odd because when I subscribe to all syms you can see that `ZB is definitely sym being pushed as shown below after setting upd to show !["enter]()
Any idea why its not working when I specify the sym
|
You can check .u.w at ticker plant.<o:p></o:p>
make sure `ZB is in the dictionary.<o:p></o:p>
<o:p> </o:p>
???: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] ?? rtrader
???: 2016?8?8? 23:53
???: Kdb+ Personal Developers <personal-kdbplus@googlegroups.com>
??: [personal kdb+] Tickerplant subscription by sym<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
|
down vote[favorite](“http://stackoverflow.com/questions/38832447/tickperplant-subscription-by-sym” "“Click”)<o:p></o:p>
|
I have a ticker plant that has the schema:<o:p></o:p>
quote:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
trade:([]time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
rfills:([]time:();sym:();expiration:();tag:();price:();volume:())
I then double check the schema by doing<o:p></o:p>
meta trade
<o:p></o:p>
I subscribe to the tickerplant as such getting the trade table<o:p></o:p>
h(`.u.sub;`trade;`)
But when I try to specify a symbol from sym by doing<o:p></o:p>
h(`.u.sub;`trade;`ZB)
No records are being pushed, This is odd because when I subscribe to all syms you can see that `ZB is definitely sym being pushed as shown below after setting upd to show
<o:p></o:p>
Any idea why its not working when I specify the sym<o:p></o:p>
|
–
Submitted via Google Groups
![]()
![]()
This is what is confusing when I evaluated .u.w I got
But when I evaluated it again I got
On Monday, August 8, 2016 at 9:24:51 PM UTC-5, Roy wrote:
You can check .u.w at ticker plant.
make sure `ZB is in the dictionary.
???: personal…@googlegroups.com [mailto:personal…@googlegroups.com] ?? rtrader
???: 2016?8?8? 23:53
???: Kdb+ Personal Developers <personal…@googlegroups.com>
??: [personal kdb+] Tickerplant subscription by sym
|
down vote[favorite](“http://stackoverflow.com/questions/38832447/tickperplant-subscription-by-sym” "“Click”)
|
I have a ticker plant that has the schema:
quote:(time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
trade:(time:(); sym:();expiration:();mtype:();price:();cond:();exchange:();volume:())
rfills:(time:();sym:();expiration:();tag:();price:();volume:())
I then double check the schema by doing
meta trade
!["table]()
I subscribe to the tickerplant as such getting the trade table
h(.u.sub;
trade;`)
But when I try to specify a symbol from sym by doing
h(.u.sub;
trade;`ZB)
No records are being pushed, This is odd because when I subscribe to all syms you can see that `ZB is definitely sym being pushed as shown below after setting upd to show !["enter]()
Any idea why its not working when I specify the sym
|
–
Submitted via Google Groups
Send this from your subscriber and let us know what it returns:
h"(.u.w;.z.w)"
it returns:
(logmsg
quoterfills
tradetradee!(((472i;
);(480i;);(476i;
));((472i;);(480i;
);(476i;));((472i;
);(480i;);(476i;
));((472i;);(480i;
);(476i;);(500i;
));((472i;);(480i;
);(476i;`)));500i)
That’s the subscription to all though right, that’s the one that works.
What does it turn for your subscriber to `ZB only?
sorry about that when I subscribe to `ZB only I get
(logmsg
quoterfills
tradetradee!(((472i;
);(480i;);(476i;
));((472i;);(480i;
);(476i;));((472i;
);(480i;);(476i;
));((472i;);(480i;
);(476i;);(488i;
ZB));((472i;);(480i;
);(476i;`)));488i)
I can’t see how you’re not getting it then!
Might be an idea to (temporarily) capture all incoming messages to your subscriber… Assuming it’s a kdb process that’s subscribing. Define the following:
incoming:();
.z.ps:{incoming,:enlist x;value x}
Then inspect the incoming to see if it’s something in your subscriber.
If your incoming remains empty, then either there are no `ZB messages being sent, or the TP is hitting an error as it tries to publish to you.
Must be something with the tickerplant I guess, will keep investigating. Extremely frustrating as I cant pin point whats wrong here. incoming is empty when subscribing to `ZB but populates when subscribing to all syms
Figured out what washappening here. So I was publishing a single record not a table from qSharp:
string giantstring2 = ".u.upd[" + "
trade;" + qdatetime + “,” + rsymbol + “,” + rexp + “,” + qtype + “,” + qprice + “,” + qcondition + “,” + qexchange + “,” + qvolume + " ]"; q.Async(giantstring2);`
I then set .u.upd to be .u.pub . So clients are recieve the single record but since its not a table nor a key value pair it doesn’t grab the sym. So then I decided to change .u.upd to be
![]()
So now subscribing by sym works however there is another issue, now it keeps publishes the entire table not just the record. Thinking of how to make this do what I want however I’m not sure how to go about it. Upon investigation of the .u.pub function
{[t;x]{[t;x;w]if[count x:sel[x]w 1;(neg first w)(
upd;t;x)]}[t;x]each w t}`
It looks like it goes through the table and publishes each record. I assume I can edit this to just submit the last record and everything should work how I expect it to. Although I am unsure how to that. Any ideas?