I am wondering what the expected time for a single bet to be cancelled on a market would be. I am getting ~200ms on average, I feel this is slow. Time taken is from CancelInstruction request from my client code until receipt of CancelExecutionReport by my client.
Time elapsed to cancel bet
Collapse
X
-
The code that takes the time is P2 to P3a (added the console lines to see where things were taking time):
Console.BackgroundColor = ConsoleColor.Yellow;
Console.WriteLine("P2 Time taken so for {0} milliseconds", (DateTime.UtcNow - t).TotalMilliseconds);
Console.BackgroundColor = ConsoleColor.Black;
using (HttpWebResponse response = (HttpWebResponse)GetWebResponse(request))
{
Console.BackgroundColor = ConsoleColor.Yellow;
Console.WriteLine("P3a Time taken so for {0} milliseconds", (DateTime.UtcNow - t).TotalMilliseconds);
Console.BackgroundColor = ConsoleColor.Black;
using (Stream stream = response.GetResponseStream())
{
Console.BackgroundColor = ConsoleColor.Yellow;
Console.WriteLine("P3b Time taken so for {0} milliseconds", (DateTime.UtcNow - t).TotalMilliseconds);
Console.BackgroundColor = ConsoleColor.Black;
Comment
-
I understand that, but the time you're getting is between you requesting a cancel and getting a return saying that the cancel happened.
What I'm wondering is whether your concern is that the time for you to get the result message back is 200ms or whether you are concerned that the actual cancellation of the bet takes 200ms.
From what I can see, if it takes 200ms to get informed of the cancellation, the cancellation itself will have taken somewhere between 0ms and 200ms. Maybe 100ms or 120ms or 150ms. Or some other number.
So do you think 200ms is longer than you would expect for the cancellation to happen, or is 200ms longer than you'd expect to learn about the result of the cancellation?
Comment
-
My main concern is the time of the cancelation to take effect. I realised the time is for a single cancelation request containing multiple cancellation instructions (5-8). It does appear that the time is a function like ( a + b * numberCancellationInstructions). I think a would be the overhead related to transmission (other operations with more data take less time).
I think I remember reading that the cancelations are queued and are acted on in series rather than parallel. So it looks like there must be some server side overhead of say 25-50ms per instruction.
It would be interesting to get others' experience on this. I will need to factor in this lag into my models....
Comment
-
While I was typing the latest reply above, I recalled reading about some kind of set change time for Betfair prices and I think it's a fifth of a second, which would equate with your 200ms measurement. I've tried searches to see what I could find for you, but it's not letting me. It may have been in connection with developers not needing to send market book requests more than five times a second. Perhaps someone else can suggest whether this is the case.
Comment


Comment