Hi,

tried it out. It now continues to run, but!
bookbalance goes to zero and price to -1!?

Excerpt from the marketdata:
092810,225959,-2.28,1.35855
092810,230000,-2.28,1.35855
092810,230001,0.0,-1
092810,230002,0.0,-1
092810,230003,0.0,-1
092810,230004,0.0,-1
092810,230005,0.0,-1
092810,230006,0.0,-1


Here is how I did the integration:
  public synchronized MarketSnapshot getMarketSnapshot(long time) {
        if (midPointPrice == 0) {
            // This is normal. It happens at the very start when
market depth is initializing.
            return null;
        }

        if (!balances.isEmpty()) {
            double multiplier = 2.0 / (balances.size() + 1.0);
            for (double balance : balances) {
                averageBalance += (balance - averageBalance) *
multiplier;
            }
        }

        if (Double.isNaN(averageBalance)) {
            averageBalance = 0;
          }

        double oneSecondBalance =
Double.valueOf(df2.format(averageBalance));
        MarketSnapshot marketSnapshot = new MarketSnapshot(time,
oneSecondBalance, midPointPrice);
        balances.clear();

        return marketSnapshot;
    }

I hope, this was correct.

I am also wondering: would it be possible to fix the problem in a way
so that simply the last
price would be repeated instead of -1?

Normally, I would think this is pretty straightforward: you save the
last one, and repeat it, if you get the NaN Balance, but: what if
there are multiple instruments: wouldn't this confuse the prices?
I am not sure regarding the code here.

Cheers
 Klaus


On 28 Sep., 03:36, nonlinear5 <[email protected]> wrote:
> Klaus, can you try the workaround suggested by ecthx to see if this
> works for you. If it does, I'll put that (or the equivalent fix) in
> the next release. Thanks.
>
> On Sep 27, 6:08 pm, ecthx <[email protected]> wrote:
>
>
>
> > I think you are experiencing same issue that I reported last year.
>
> >http://code.google.com/p/jbooktrader/issues/detail?id=21
>
> > On Sep 27, 4:11 pm, Klaus <[email protected]> wrote:
>
> > > Just uploaded the eventreport from today.
> > > As usual right after market closed it stoped.
>
> > > Also on the interface level everything stoped updating, but in the
> > > marketdata files EUR-FUT
> > > continued while EUR did stop. Enclosed is the tail of the respective
> > > files
>
> > > EURFX
> > > 092710,225956,-8.11,1.34545
> > > 092710,225957,-0.49,1.3454
> > > 092710,225958,-1.62,1.34545
> > > 092710,225959,-0.31,1.34545
> > > 092710,230000,-2.23,1.34545
> > > 092710,230001,-11.49,1.3454
>
> > > EUR-FUT
> > > 092710,165957,-37.14,1.34505
> > > 092710,165958,-37.14,1.34505
> > > 092710,165959,-38.89,1.34505
> > > 092710,170000,-38.89,1.34505
> > > 092710,170001,-38.89,1.34505
> > > 092710,170002,-38.89,1.34505
> > > 092710,170003,-38.89,1.34505
> > > 092710,170004,-61.42,1.34495
> > > 092710,170005,-61.42,1.34495
> > > 092710,170006,-61.42,1.34495
> > > 092710,170007,-61.42,1.34495
> > > 092710,170008,-61.42,1.34495
> > > 092710,170009,-61.42,1.34495
> > > 092710,170010,-61.42,1.34495
> > > 092710,170011,-61.42,1.34495
> > > 092710,170012,-61.42,1.34495
> > > 092710,170013,-61.42,1.34495
> > > 092710,170014,-61.42,1.34495
> > > 092710,170015,-61.42,1.34495
> > > 092710,170016,-61.42,1.34495
> > > 092710,170017,-61.42,1.34495
> > > 092710,170018,-61.42,1.34495
> > > 092710,170019,-61.42,1.34495
> > > 092710,170020,-61.42,1.34495
> > > 092710,170021,-61.42,1.34495
> > > 092710,170022,-61.42,1.34495
> > > 092710,170023,-61.42,1.34495
> > > 092710,170024,-61.42,1.34495
> > > 092710,170025,-61.42,1.34495
> > > 092710,170026,-61.42,1.34495
> > > 092710,170027,-61.42,1.34495
> > > 092710,170028,-61.42,1.34495
> > > 092710,170029,-61.42,1.34495
> > > 092710,170030,-61.42,1.34495
> > > 092710,170031,-61.42,1.34495
> > > 092710,170032,-61.42,1.34495
> > > 092710,170033,-61.42,1.34495
> > > 092710,170034,-61.42,1.34495
> > > 092710,170035,-61.42,1.34495
> > > 092710,170036,-61.42,1.34495
> > > 092710,170037,-61.42,1.34495
> > > 092710,170038,-61.42,1.34495
> > > 092710,170039,-61.42,1.34495
> > > 092710,170040,-61.42,1.34495
> > > 092710,170041,-61.42,1.34495
> > > 092710,170042,-61.42,1.34495
> > > 092710,170043,-61.42,1.34495
> > > 092710,170044,-61.42,1.34495
> > > 092710,170045,-61.42,1.34495
> > > 092710,170046,-61.42,1.34495
> > > 092710,170047,-61.42,1.34495
> > > 092710,170048,-61.42,1.34495
> > > 092710,170049,-61.42,1.34495
> > > 092710,170050,-61.42,1.34495
> > > 092710,170051,-61.42,1.34495
> > > 092710,170052,-61.42,1.34495
> > > 092710,170053,-61.42,1.34495
> > > 092710,170054,-61.42,1.34495
> > > 092710,170055,-61.42,1.34495
> > > 092710,170056,-61.42,1.34495
> > > 092710,170057,-61.42,1.34495
> > > 092710,170058,-61.42,1.34495
> > > 092710,170059,-61.42,1.34495
> > > 092710,170100,-61.42,1.34495
> > > 092710,170101,-61.42,1.34495
> > > 092710,170102,-61.42,1.34495
> > > 092710,170103,-61.42,1.34495
> > > 092710,170104,-61.42,1.34495
> > > 092710,170105,-61.42,1.34495
> > > 092710,170106,-61.42,1.34495
> > > 092710,170107,-61.42,1.34495
> > > 092710,170108,-61.42,1.34495
> > > 092710,170109,-61.42,1.34495
> > > 092710,170110,-61.42,1.34495
> > > 092710,170111,-61.42,1.34495
>
> > > On Sep 25, 8:58 pm, nonlinear5 <[email protected]> wrote:
>
> > > > > Any suggestions welcome.
>
> > > > Can you please post your EventReport.htm? Your expectation is correct:
> > > > the data recording should never stop even if market data is
> > > > unavailable.

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