Maspear / jbooktrader

Automatically exported from code.google.com/p/jbooktrader
0 stars 0 forks source link

DepthVelocity.java name change recommendation #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
>What steps will reproduce the problem?

DepthVelocity.java calculates change in position (Delta) not Velocity (rate
of change in position):

    public double calculate() {
        int indexNow = marketBook.size() - 1;
        int indexThen = indexNow - period;
        value = getDepthBalance(indexNow) - getDepthBalance(indexThen);
        return value;
    }

>What is the expected output? What do you see instead?

Velocity = "rate of change in position" should be calculated (Delta in
DepthBalance) divided by (Delta in Time).

E.g.:

    public double calculate() {
        int indexNow = marketBook.size() - 1;
        int indexThen = indexNow - period;
        int delta = getDepthBalance(indexNow) - getDepthBalance(indexThen);
        value = delta / period;
        return value;
    }

What version of the product are you using? On what operating system?
JBT 2.08

>Please provide any additional information below.
Time normalization is preferred. E.g. we should implement a function for
converting period to hours or seconds. It will be more easy to compare
different strategies and time frames when we speak in normalized units.

Kind regards,
Andrey Bogomolov.

Original issue reported on code.google.com by andrey.b...@gmail.com on 11 Apr 2008 at 6:26

GoogleCodeExporter commented 9 years ago
I made the change in my JBT but the line

int delta = getDepthBalance(indexNow) - getDepthBalance(indexThen);

has to be changed by 

double delta = getDepthBalance(indexNow) - getDepthBalance(indexThen);

Thank you for your work

Original comment by gabrield...@gmail.com on 11 Apr 2008 at 9:44

GoogleCodeExporter commented 9 years ago
Fixed in 3.04

Original comment by eugene.k...@gmail.com on 8 Jun 2008 at 7:15