
|
Bug in PaperBroker ?
Hi there, while developing i though and found something interesting ... As the paper broker subscribes to the quote feed upon order submission, it will not know the current prices of assets. It will only know them upon update.
I think it might make sense to either a) make the paper broker subscribe to some sort of a wildcard stream so that it can internally maintain a price sheet b) make the quote subscription source upon subscription activation send out the current prices
Thoughts ? /u -- Ulrich B. Staudinger
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
Ulrich, you basically suggest to make PaperBroker aware of the **past** prices for the security. What is the use for that? Any use of these past prices will reflect past, not present. For example, if PaperBroker would decide to issue a fill on this basis, it will be incorrect. When price quotes are rare (low liquidity) use of past prices for doing fill is even more dangerous as price is likely to swing widely. And if instrument is liquid, then price quote will come pretty fast and there is no problem. What I am missing here?
-Mike On Wed, Sep 23, 2009 at 8:18 AM, Ulrich Staudinger <ustaudinger@...> wrote:
Hi there,
while developing i though and found something interesting ... As the paper broker subscribes to the quote feed upon order submission, it will not know the current prices of assets. It will only know them upon update.
I think it might make sense to either a) make the paper broker subscribe to some sort of a wildcard stream so that it can internally maintain a price sheet b) make the quote subscription source upon subscription activation send out the current prices
Thoughts ?
/u
-- Ulrich B. Staudinger
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
On Wed, Sep 23, 2009 at 2:31 PM, Mike Kroutikov <pgmmpk@...> wrote:
Ulrich, you basically suggest to make PaperBroker aware of the **past** prices for the security. What is the use for that? Any use of these past prices will reflect past, not present. For example, if PaperBroker would decide to issue a fill on this basis, it will be incorrect. When price quotes are rare (low liquidity) use of past prices for doing fill is even more dangerous as price is likely to swing widely. And if instrument is liquid, then price quote will come pretty fast and there is no problem. What I am missing here?
The current prices are the prices that can be traded. If a product is currently quoted like this ... Bidvol@Bid: 1000@15 AskVol@Ask: 500@...... then once can buy a maximum of 500 at 15.5.
Especially for products where the quote doesn't move but stays at a price level, the paper broker wouldn't be (and isn't) aware of the current price level until the next quote arrives. ? /u
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
The current prices are the prices that can be traded.
If a product is currently quoted like this ... Bidvol@Bid: 1000@15 AskVol@Ask: 500@...... then once can buy a maximum of 500 at 15.5.
Especially for products where the quote doesn't move but stays at a price level, the paper broker wouldn't be (and isn't) aware of the current price level until the next quote arrives.
... which results in no trade, although it could ... Do i miss something ? /u
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
Yes, formally speaking, the "current" top of the book can be traded. However, quotes are generated more often than actual trades (market/limit/stop trade changes price or quantity of the bid/ask, therefore generating a quote. Additionally, orders are being added/canceled on the top of the book which adds "tradeless" quotes). Therefore if you are seeing problems with using "future" quotes as base for the trade simulation, then you are trading much faster than the actual market you are targeting. And here the model that assumes that you do not impact the market (the assumption behind PaperBroker) may not hold. So, I would (personally) prefer a pessimistic simulator that "delays" execution till next trade or quote arrives from the feed. Note that current PaperBroker is already somewhat optimistic in this sense as it uses quotes (not trades) as the basis for fill, and also it does not delay orders to adjust for the latency that in real world is non-zero...
But if you still want to be optimistic about your order execution, then yout can do this. The right place to "fix" it is at the quote source (i.e. a special quote source that pre-subscribes to the feed and generates fantom quote whenever someone subscribes to it...)
I am curious which market you are dealing with? And what is the average frequency of quotes there?
On Wed, Sep 23, 2009 at 8:38 AM, Ulrich Staudinger <ustaudinger@...> wrote:
On Wed, Sep 23, 2009 at 2:31 PM, Mike Kroutikov <pgmmpk@...> wrote:
Ulrich, you basically suggest to make PaperBroker aware of the **past** prices for the security. What is the use for that? Any use of these past prices will reflect past, not present. For example, if PaperBroker would decide to issue a fill on this basis, it will be incorrect. When price quotes are rare (low liquidity) use of past prices for doing fill is even more dangerous as price is likely to swing widely. And if instrument is liquid, then price quote will come pretty fast and there is no problem. What I am missing here?
The current prices are the prices that can be traded. If a product is currently quoted like this ... Bidvol@Bid: 1000@15 AskVol@Ask: 500@...... then once can buy a maximum of 500 at 15.5.
Especially for products where the quote doesn't move but stays at a price level, the paper broker wouldn't be (and isn't) aware of the current price level until the next quote arrives. ?
/u
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
Hi, i think that is pretty common that the quotes stay at a level and no quote updates come in ... Especially in simulations it is even more common. Indeed, when a trade happens, a quote update should be sent out by the exchange.
In the attached screenshot, you can see the crude oil from ten minutes ago.Red line indicating the bid, green the ask. If i had placed a buy order at limit 70.35 at 16:08:27, it would never get filled as no quote update would have arrived. Same at 16:08:40 ... I think the proper term is price taking in this context.
Indeed the proxying quote source is the way to go, i see it the same, the source resending the current market price to the subscriber upon subscription activation. Cheers !
On Wed, Sep 23, 2009 at 3:52 PM, Mike Kroutikov <pgmmpk@...> wrote:
Yes, formally speaking, the "current" top of the book can be traded. However, quotes are generated more often than actual trades (market/limit/stop trade changes price or quantity of the bid/ask, therefore generating a quote. Additionally, orders are being added/canceled on the top of the book which adds "tradeless" quotes). Therefore if you are seeing problems with using "future" quotes as base for the trade simulation, then you are trading much faster than the actual market you are targeting. And here the model that assumes that you do not impact the market (the assumption behind PaperBroker) may not hold. So, I would (personally) prefer a pessimistic simulator that "delays" execution till next trade or quote arrives from the feed. Note that current PaperBroker is already somewhat optimistic in this sense as it uses quotes (not trades) as the basis for fill, and also it does not delay orders to adjust for the latency that in real world is non-zero...
But if you still want to be optimistic about your order execution, then yout can do this. The right place to "fix" it is at the quote source (i.e. a special quote source that pre-subscribes to the feed and generates fantom quote whenever someone subscribes to it...)
I am curious which market you are dealing with? And what is the average frequency of quotes there?
On Wed, Sep 23, 2009 at 8:38 AM, Ulrich Staudinger <ustaudinger@...> wrote:
On Wed, Sep 23, 2009 at 2:31 PM, Mike Kroutikov <pgmmpk@...> wrote:
Ulrich, you basically suggest to make PaperBroker aware of the **past** prices for the security. What is the use for that? Any use of these past prices will reflect past, not present. For example, if PaperBroker would decide to issue a fill on this basis, it will be incorrect. When price quotes are rare (low liquidity) use of past prices for doing fill is even more dangerous as price is likely to swing widely. And if instrument is liquid, then price quote will come pretty fast and there is no problem. What I am missing here?
The current prices are the prices that can be traded. If a product is currently quoted like this ... Bidvol@Bid: 1000@15 AskVol@Ask: 500@...... then once can buy a maximum of 500 at 15.5.
Especially for products where the quote doesn't move but stays at a price level, the paper broker wouldn't be (and isn't) aware of the current price level until the next quote arrives. ?
/u
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
-- Ulrich B. Staudinger
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
Nice charts :)
What is that gray line on the OIL chart? Looks like trades (buys touch ask quote level and sells touch bid level).
If you have both quote and trade feed, then you can "manufacture" a combined quote stream that also issues quote whenever a trade comes in. This can be an alternative to the snapshot quote. Another idea would be to have a proxy that generates quotes with given frequency (settable parameter) from less frequent quote stream...
Generally speaking, the PaperBroker assumes certain high-detailed quote stream. If the actual quote stream is compressed (for example when bid/ask size is not reported and quote is not generated unless price moves), then something has to be done to "uncompress" it. Any method will do (with the understanding what model is behind it). Your suggestion of issuing quote snapshot at subscription time is very reasonable.
On Wed, Sep 23, 2009 at 10:18 AM, Ulrich Staudinger <ustaudinger@...> wrote:
Hi, i think that is pretty common that the quotes stay at a level and no quote updates come in ... Especially in simulations it is even more common. Indeed, when a trade happens, a quote update should be sent out by the exchange.
In the attached screenshot, you can see the crude oil from ten minutes ago.Red line indicating the bid, green the ask. If i had placed a buy order at limit 70.35 at 16:08:27, it would never get filled as no quote update would have arrived. Same at 16:08:40 ... I think the proper term is price taking in this context.
Indeed the proxying quote source is the way to go, i see it the same, the source resending the current market price to the subscriber upon subscription activation.
Cheers !
On Wed, Sep 23, 2009 at 3:52 PM, Mike Kroutikov <pgmmpk@...> wrote:
Yes, formally speaking, the "current" top of the book can be traded. However, quotes are generated more often than actual trades (market/limit/stop trade changes price or quantity of the bid/ask, therefore generating a quote. Additionally, orders are being added/canceled on the top of the book which adds "tradeless" quotes). Therefore if you are seeing problems with using "future" quotes as base for the trade simulation, then you are trading much faster than the actual market you are targeting. And here the model that assumes that you do not impact the market (the assumption behind PaperBroker) may not hold. So, I would (personally) prefer a pessimistic simulator that "delays" execution till next trade or quote arrives from the feed. Note that current PaperBroker is already somewhat optimistic in this sense as it uses quotes (not trades) as the basis for fill, and also it does not delay orders to adjust for the latency that in real world is non-zero...
But if you still want to be optimistic about your order execution, then yout can do this. The right place to "fix" it is at the quote source (i.e. a special quote source that pre-subscribes to the feed and generates fantom quote whenever someone subscribes to it...)
I am curious which market you are dealing with? And what is the average frequency of quotes there?
On Wed, Sep 23, 2009 at 8:38 AM, Ulrich Staudinger <ustaudinger@...> wrote:
On Wed, Sep 23, 2009 at 2:31 PM, Mike Kroutikov <pgmmpk@...> wrote:
Ulrich, you basically suggest to make PaperBroker aware of the **past** prices for the security. What is the use for that? Any use of these past prices will reflect past, not present. For example, if PaperBroker would decide to issue a fill on this basis, it will be incorrect. When price quotes are rare (low liquidity) use of past prices for doing fill is even more dangerous as price is likely to swing widely. And if instrument is liquid, then price quote will come pretty fast and there is no problem. What I am missing here?
The current prices are the prices that can be traded. If a product is currently quoted like this ... Bidvol@Bid: 1000@15 AskVol@Ask: 500@...... then once can buy a maximum of 500 at 15.5.
Especially for products where the quote doesn't move but stays at a price level, the paper broker wouldn't be (and isn't) aware of the current price level until the next quote arrives. ?
/u
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
-- Ulrich B. Staudinger
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|

|
Re: Bug in PaperBroker ?
On Wed, Sep 23, 2009 at 4:42 PM, Mike Kroutikov <pgmmpk@...> wrote:
Nice charts :)
What is that gray line on the OIL chart? Looks like trades (buys touch ask quote level and sells touch bid level).
Indeed trades ... I'll add some sort of a proxy quote source that will reemit upon subscription the last quote for that instrument.
Thanks for discussion, /u
-- Ulrich B. Staudinger
_______________________________________________
ccapi mailing list
ccapi@...
http://activestocks.de/cgi-bin/mailman/listinfo/ccapi
|