>From your description, it sounds like the inconsistencies are caused by timers starting off out of phase (or drifting out of phase), resulting in different sampled depth balances.
One solution might be to calculate all possible depth samplings, and take the average for each second. So for each market update that you get (100's per second), you could calculate a 'rolling' depth balance based on all the updates that arrived in the previous second. Then when the timer fires, this mean rolling depth should be closely matched even if timers are out of phase between computers. Obviously, the 'chunkier' the order sizes are in the time interval of interest, the more sensitive the depth sample will be to the precise sampling time (even when the sample is 'rolling'). Then the only solution is to estimate that variability (i.e., what is the distribution of depths when sampled at a random phase), and adjust your strategy so it only trade when the signals are above this known noise. On Aug 19, 7:53 pm, nonlinear5 <[email protected]> wrote: > The long time JBTers are aware of this problem: when multiple people > run the same strategy in the same time frame, their results may be > different. For the benefit of everyone, I'd like to explain why this > happens, and perhaps someone would come up with an idea to improve the > consistency. > > When JBT runs in the "trade" and "forward test" mode, it's driven by a > timer which fires 1 time per second. Every time the timer fires, JBT > calculates the depth balance as the midpoint between the lowest and > the highest depth balance observed during that second. This midpoint > balance is what gets fed to the indicators, which ultimately generate > trading signals. This approach works fairly well. We've run multiple > multi-user tests in the past, and I am also regularly checking my > results with another JBTer who runs the same strategies. Most of the > time, the results match well, with occasional exceptions. Here is why > these exceptions occur: > > The timer uses the computer clock, and obviously, everyone's clock is > different. When user A samples 1-second interval, it may be, say, > 10:00:05.200 to 10:00:06.200 real time period. By "real time", I mean > the most precise, atomic time, which is the same for everyone. At the > same time, user B sample could be 10:00:05.900 to 10:00:06.900, > measured by the same atomic clock. So, users A and B are "out of > phase" by about 700 milliseconds. As a consequence, their min/max > depth balance observations would differ by small amount. Now, imagine > that some strategy triggers a long trade when the indicator value > exceeds 100. Because of the small differences, the indicator for user > A may reach 100.01 and trigger a trade, while the same indicator for > user B may reach 99.99 and drop off, never triggering a trade. An > additional source of the differences is the PC clock drift, which may > cause JBT to sample overlapping periods, or to have gaps in the > samples. > > Here are a couple of ideas that I have to improve the multi-user > consistency: > > 1. Instead of the midpoint depth balance, use a 1-second average (or > an exponential average) of the depth balance. > > 2. Instead of using the PC clock, obtain the atomic time from a time > server (such as the US Naval Observatory time server), and trigger > depth balance sampling based on the changes in that atomic clock. This > would involve continuous polling of the time server, multiple times > per second. This is easy to do in Java, but it may not be reliable, as > the server may go down. The server may also deny service, if the > requests are deemed to be too frequent. > > If you have any other ideas, feel free to share with the group. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JBookTrader" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en -~----------~----~----~----~------~----~------~--~---
