NexusFi: Find Your Edge


Home Menu

 





Tape/Time and Sales: why actual trades do not decrease bid/ask sizes?


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Nicolas11 with 17 posts (9 thanks)
    2. looks_two Jigsaw Trading with 11 posts (5 thanks)
    3. looks_3 Jura with 4 posts (3 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one SPMC with 1 thanks per post
    2. looks_two Jura with 0.8 thanks per post
    3. looks_3 Nicolas11 with 0.5 thanks per post
    4. looks_4 Jigsaw Trading with 0.5 thanks per post
    1. trending_up 18,304 views
    2. thumb_up 18 thanks given
    3. group 5 followers
    1. forum 33 posts
    2. attach_file 1 attachments




 
Search this Thread

Tape/Time and Sales: why actual trades do not decrease bid/ask sizes?

  #21 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

So, the approach is quite different between MC and SC.

To simplify, let's suppose that MC and SC codes are both executed every 0.1s.

MultiCharts
Each 0.1s, MC code gets the InsideBid / InsideAsk and prints it : one line is printed.

Sierra Chart
There are 2 modes with SC.
Charts and indicators are also updated each 0.1s or whatever frequency defined by the user.
But there is another mode specific to T&S. With function sc.GetTimeAndSales(), we have an asynchronous access to all messages received from the feed. These messages are queued by SC when received and are available when the function is called.
So...
Each 0.1s, SC code reads all the messages arrived from the feed in the last 0.1s one by one: several lines are printed (as many lines as updates received from the feed during the 0.1s).

In other words, if InsideBid or InsideAsk has been updated 0.001s after the trade, MC code will probably miss this update whereas SC will print it. Because, by design, all messages from the feed are kept and queued in SC when dealing with T&S.

At least, it is my understanding.

Quite interesting...

Nicolas

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
32 thanks
Just another trading journal: PA, Wyckoff & Trends
26 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #22 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


Nicolas11 View Post
In other words, if InsideBid or InsideAsk has been updated 0.001s after the trade, MC code will probably miss this update whereas SC will print it. Because, by design, all messages from the feed are kept and queued in SC when dealing with T&S.

There's might also be another approach as I understand it correctly from NinjaTrader's OnMarketDepth method, which gets updated on every change in market depth (so presumably independent of time).

I couldn't get the code to work (I don't know much NinjaTrader), but here's what I have so far:

 
Code
		protected override void OnMarketDepth(MarketDepthEventArgs e)
		{
			if (e.MarketDataType == MarketDataType.Last)
			{
				Print(DateTime.Now.ToString("HH:mm:ss:fff") + " Trade done: " + e.Volume + 
					" Bid: " + GetCurrentBidVolume() + " Ask: " + GetCurrentAskVolume());
			}
			else if (e.MarketDataType == MarketDataType.Ask || e.MarketDataType == MarketDataType.Bid)
			{		
				Print(DateTime.Now.ToString("HH:mm:ss:fff") + " Update without trade. " + 
					" Bid: " + GetCurrentBidVolume() + " Ask: " + GetCurrentAskVolume());
			} 
		}

Reply With Quote
Thanked by:
  #23 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


What about MC .NET?

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #24 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


Nicolas11 View Post
What about MC .NET?

I don't know. Ironically I find NinjaTrader's documentation much more understandable, even though I practically never use NinjaTrader/NinjaScript. MC .NET's 'documentation' (read: references) are still foreign to me.

Reply With Quote
Thanked by:
  #25 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393


Jura View Post
There's might also be another approach as I understand it correctly from NinjaTrader's OnMarketDepth method, which gets updated on every change in market depth (so presumably independent of time).

I couldn't get the code to work (I don't know much NinjaTrader), but here's what I have so far:

 
Code
		protected override void OnMarketDepth(MarketDepthEventArgs e)
		{
			if (e.MarketDataType == MarketDataType.Last)
			{
				Print(DateTime.Now.ToString("HH:mm:ss:fff") + " Trade done: " + e.Volume + 
					" Bid: " + GetCurrentBidVolume() + " Ask: " + GetCurrentAskVolume());
			}
			else if (e.MarketDataType == MarketDataType.Ask || e.MarketDataType == MarketDataType.Bid)
			{		
				Print(DateTime.Now.ToString("HH:mm:ss:fff") + " Update without trade. " + 
					" Bid: " + GetCurrentBidVolume() + " Ask: " + GetCurrentAskVolume());
			} 
		}

There is a flaw in what you are trying to do here. I suspect it's the same thing being attempted across all platforms.

The Time & Sales AKA Level 1 feed is EITHER
- A trade
- A change in bid
- A change in offer

That is all.

So - what you are doing here in the code above is getting a trade message:

MarketDataType.Last

But somehow expecting that message to also give you the bid & ask as well as the trade. This isn't the way the feed works.

The GetCurrentAskVolume() method will not give you the new bid/ask data because the bid/ask message has not come through yet. There are a few ways to get the current inside bid/ask and some are more timely than others.

The Time & Sales window in Ninja has a section at the top that shows the inside bid/offer info. From memory I believe that is what you are accessing with GetCurrentAskVolume(). This value is not updated on every change as Ninja would end up spinning the wheels just keeping that updated.

To interrogate the inside bid/ask - you have to wait for the L1 bid ask messages.
MarketDataType.Last - trade
MarketDataType.Bid - Inside bid update
MarketDataType.Ask - Inside Ask update

There is no way to get an update to the inside bid/ask BEFORE the MarketDataType.Bid or MarketDataType.Ask message gets to you.

Also - in the above code, you should be using OnMarketData NOT OnMarketDepth - OnMarketDepth is the L2 feed and has updates to all levels and therefore many times more messages than OnMarketData which is the Level 1 feed.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #26 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

@DionysusToast,

Thanks for your message.

"There is a flaw in what you are trying to do here. I suspect it's the same thing being attempted across all platforms."

I will just answer for Sierra Chart.
I humbly think that there is no flaw, since, if no mistake, I am doing exactly what you say (or my understanding of what you say).
The code waits for the L1 messages and reads them one after the other.
As you say, these messages are either a trade or an update.
The code distinguishes the two and adapts the printing.
(The code does not try to have the trade and the update at the same time.)

What I wanted to check is: does the UPDATE message received just after a TRADE message reflects the liquidity which disappeared due to the trade?

To put it short...
With CME product I tested, the answer is: YES so no problem (refer to my message with all the colors)
With EUREX product I tested, the answer is: NO so there is something to be clarified. I have sent an e-mail to DTN IQFeed.

Once more, I am not disagreeing with you. I am just trying to explain what I have done. Except if I have missed something, it seems consistent with your recommendations.

Thanks again,

Nicolas

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #27 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393

@Nicolas11 - sorry - I meant that the code Jura presented is flawed as it tries to get an updated bid/offer when a trade comes in.

In terms of the results you show in the first message, you have this:

Update without trade: Price = 7070.0 - AskSize = 12 - BidSize = 3 | 2012-08-20 12:54:00
New trade at the BID: 1 @ 7070.0 - AskSize = 12 - BidSize = 3 | 2012-08-20 12:54:00
Update without trade: Price = 7070.0 - AskSize = 1 - BidSize = 3 | 2012-08-20 12:54:00

Do you have the messages that came after this? I agree that you should get a bid update at this point.

The 3rd line there is an Ask update. To have no Bid update here would be counter to what the US exchanges do (as you know)

Perhaps Eurex thinks there's no need to send a bid update in this case as nothing is pulled from the bid and no bid changes have occured. You can figure it out for yourself, efectively. Seems an odd thing to do.

Have you tried FESX/FGBL?

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #28 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

To better illustrate the difference I see between CME and EUREX, below please find a comparison between ES, FESX and BUND. All with the same Sierra Chart code. All a few minutes ago.

(1) ES @ CME : after trades at the bid, a message is sent to reflect that the bid size has decreased by the volume of the trades (same for ask)

[63518] Update without trade: Ask = 213 @ 1417.50 - Bid = 68 @ 1417.25 | 2012-08-21 02:28:25
[63519] New trade at the BID: 2 @ 1417.25 - Ask = 213 @ 1417.50 - Bid = 68 @ 1417.25 | 2012-08-21 02:28:25
[63520] Update without trade: Ask = 213 @ 1417.50 - Bid = 66 @ 1417.25 | 2012-08-21 02:28:25
--> 68 - 2 = 66... fine!

[63522] Update without trade: Ask = 213 @ 1417.50 - Bid = 62 @ 1417.25 | 2012-08-21 02:28:25
[63523] New trade at the BID: 5 @ 1417.25 - Ask = 213 @ 1417.50 - Bid = 62 @ 1417.25 | 2012-08-21 02:28:25
[63524] New trade at the BID: 3 @ 1417.25 - Ask = 213 @ 1417.50 - Bid = 62 @ 1417.25 | 2012-08-21 02:28:25
[63525] New trade at the BID: 1 @ 1417.25 - Ask = 213 @ 1417.50 - Bid = 62 @ 1417.25 | 2012-08-21 02:28:25
[63526] New trade at the BID: 11 @ 1417.25 - Ask = 213 @ 1417.50 - Bid = 62 @ 1417.25 | 2012-08-21 02:28:25
[63527] Update without trade: Ask = 213 @ 1417.50 - Bid = 42 @ 1417.25 | 2012-08-21 02:28:25
--> 62 - (5+3+1+11) = 42... fine!

(2) FESX @ EUREX: the update message after the trade does not reflect what happened during the trade

[108761] Update without trade: Ask = 458 @ 2484.00 - Bid = 270 @ 2483.00 | 2012-08-21 02:42:29
[108762] New trade at the BID: 10 @ 2483.00 - Ask = 458 @ 2484.00 - Bid = 270 @ 2483.00 | 2012-08-21 02:42:29
[108764] Update without trade: Ask = 487 @ 2484.00 - Bid = 216 @ 2483.00 | 2012-08-21 02:42:29
--> If the EUREX messages were like CME's, it should have been Bid = 260
[108769] Update without trade: Ask = 487 @ 2484.00 - Bid = 228 @ 2483.00 | 2012-08-21 02:42:30
[108771] Update without trade: Ask = 495 @ 2484.00 - Bid = 228 @ 2483.00 | 2012-08-21 02:42:30

[108835] Update without trade: Ask = 484 @ 2484.00 - Bid = 229 @ 2483.00 | 2012-08-21 02:42:31
[108844] New trade at the ASK: 2 @ 2484.00 - Ask = 484 @ 2484.00 - Bid = 229 @ 2483.00 | 2012-08-21 02:42:31
[108845] Update without trade: Ask = 435 @ 2484.00 - Bid = 258 @ 2483.00 | 2012-08-21 02:42:31
--> If the EUREX messages were like CME's, it should have been Ask = 482
[108853] Update without trade: Ask = 420 @ 2484.00 - Bid = 374 @ 2483.00 | 2012-08-21 02:42:31
[108867] Update without trade: Ask = 423 @ 2484.00 - Bid = 374 @ 2483.00 | 2012-08-21 02:42:31

(3) BUND @ EUREX: the update message after the trade does not reflect what happened during the trade

[86471] Update without trade: Ask = 130 @ 141.68 - Bid = 8 @ 141.67 | 2012-08-21 02:34:35
[86473] New trade at the BID: 3 @ 141.67 - Ask = 130 @ 141.68 - Bid = 8 @ 141.67 | 2012-08-21 02:34:35
[86474] Update without trade: Ask = 127 @ 141.68 - Bid = 4 @ 141.67 | 2012-08-21 02:34:35
--> If the EUREX messages were like CME's, it should have been Bid = 5

I hope that DTN IQFeed will be able to explain this difference between CME and EUREX messages. It has a huge impact on codes which could be based on L1 messages.

Nicolas

PS - According to Sierra Chart, it is normal, in SC design, that the sequence numbers between [] do not follow each other. It does not mean that there are missing messages. ( Reference)

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #29 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393

For their "Update without trade" - is that an event that SC gives you?

Actual L1 messages are either bid or offer - does it not tell you which type is coming in? Just "update without trade"?

Visit my NexusFi Trade Journal Reply With Quote
  #30 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


@DionysusToast,

For precise reference, here is the documentation: Sierra Chart - Definitions of Advanced Custom Study/System Interface Members

In summary, in Sierra Chart, Level 1 messages have a field which can only have 3 values:
  • SC_TS_BID --> trade at the Bid
  • SC_TS_ASK --> trade at the Ask
  • SC_TS_BIDASKVALUES --> "Bid and Ask quote data update"

(Actually, there is a 4th one SC_TS_MARKER to indicates a gap in the time and sales data, but, in all my checkings, I have never seen it whereas I have programmed an alert. I think it shows a gap in time: disconnection with data feed, etc.)

EDIT: To come back to your question...
"does it not tell you which type is coming in? Just "update without trade"?"
Answer is YES, just "update without trade". But I am printing nearly all the relevant fields (ask price, ask size, bid price, bid size, etc.). So we can see which one has been updated.

Nicolas

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on September 4, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts