Ok, I thought about this and here is my plan for the upcoming release:

1. Instead of using the midpoint between the minimum and maximum
balances, 1-second depth balance will be represented by an exponential
moving average of market depth. I have not yet decided what multiplier
to use for that EMA, though. During every second, market depth changes
somewhere between 10 and 70 times, with the average of about 30, so my
guess is that the best multiplier would be half the average number of
updates, i.e, ema multiplier = 2 / (15 + 1). An alternative approach
is to make the multiplier dynamic:
multiplier = 2 / (N / 2 + 1), where N is the number of depth changes
in the last second.
Intuitively, the ema of depth balance is a better representation of
the current depth balance than the midpoint between min and max. I am
also guessing that this new representation will also be much less
sensitive to sampling differences.

2. In the current implementation, the resulting 1-second balance is
rounded to the next integer:
int balance = (int) Math.round((lowBalance + highBalance) / 2d)
In the next release, I'll make it a double, and round it to two
decimal places. This should also improve consistency.

One big downside to all this is that it is unknown how it would affect
the strategies optimized on the data in the old format. That is, if
you have a strategy with a parameter which has a depth balance
threshold as a criteria for entry/exit, the value of this parameter
would probably need to change with the new depth balance
representation. To put it in other words, the previously recorded data
may need to be discarded.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to