Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

JForex 3 SDK: Market Depth.
 Post subject: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Wed 23 May, 2018, 22:00 

User rating: 4
Joined: Wed 23 May, 2018, 20:08
Posts: 44
Location: FinlandFinland
Hello,

The Tick data that I get in JForex-3-SDK in eclipse is not the newest data but old data that is not actual. My code works real-time in The JForex program, but not in JForex-3-SDK, that data is old.
How do I get the total Market Depth for each tick, can someone show me please?

How do I get the total Market depth for each tick?

Thank you in advance!


 
 Post subject: Re: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Thu 24 May, 2018, 15:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We cannot reproduce this. Ticks price and volume are identical in JForex and in JForex - SDK.

Last 10 ticks in SDK:
Time: 2018-05-24 14:36:35.998, Ask: 1.173240, Bid: 1.173200, ask volume: 2.320000, bid volume: 4.050000 
Time: 2018-05-24 14:36:36.518, Ask: 1.173250, Bid: 1.173210, ask volume: 5.700000, bid volume: 2.700000
Time: 2018-05-24 14:36:36.697, Ask: 1.173260, Bid: 1.173220, ask volume: 1.120000, bid volume: 9.670000
Time: 2018-05-24 14:36:37.211, Ask: 1.173270, Bid: 1.173230, ask volume: 2.320000, bid volume: 1.750000
Time: 2018-05-24 14:36:37.729, Ask: 1.173270, Bid: 1.173230, ask volume: 3.070000, bid volume: 2.170000
Time: 2018-05-24 14:36:38.793, Ask: 1.173250, Bid: 1.173220, ask volume: 1.500000, bid volume: 1.950000
Time: 2018-05-24 14:36:38.936, Ask: 1.173250, Bid: 1.173200, ask volume: 6.070000, bid volume: 5.700000
Time: 2018-05-24 14:36:39.057, Ask: 1.173260, Bid: 1.173230, ask volume: 4.200000, bid volume: 1.000000
Time: 2018-05-24 14:36:39.265, Ask: 1.173270, Bid: 1.173220, ask volume: 3.450000, bid volume: 2.700000
Time: 2018-05-24 14:36:39.595, Ask: 1.173270, Bid: 1.173240, ask volume: 1.200000, bid volume: 1.670000

And in JForex program:

Image

But we can do investigation at a greater time interval. Can you provide your strategy/code example?


Attachments:
Last10Ticks.JPG [60.09 KiB]
Downloaded 346 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Thu 24 May, 2018, 16:52 

User rating: 4
Joined: Wed 23 May, 2018, 20:08
Posts: 44
Location: FinlandFinland
Hello,

Thank you for your quick answer! My code is just a ITickFeedListener that prints tick.getTotalAskVolume & tick.getTotalBidVolume, no logic behind it yet.
In JForex, Dukascopy has this widget that shows the total sum of market depth and every tick it changes. I would like to get the same data as is on the widget, under the white line that is drawn on the attached picture. Can you tell me how it is calculated, please? It changes every tick and I would like to read the sum, I would like to get the data that is below the white line in my attached picture.
If you have a widget for it in JForex, it would be nice to call it with API. Now I have to take other measures to get the data.
So it is not possile to get total market depth for each tick, yet you havae this widget that does it. Make an API-call for it please, thank you!

EDIT2: Sorry, I see that the widget I have attached is not calculating volumes, but units, the question still remains if you can tell me how i get the total sum as in the attached picture, please.

EDIT: [img] did not work, so here is link to the picture https://imgur.com/a/Bc7Yw6M


 
 Post subject: Re: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Fri 25 May, 2018, 14:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Information from Market Depth Widget also is available from ITick interface, if you use it inside strategy. Output data is identical in all 3 cases: Widget, in JForex Platform, in JForex-SDK.

Ask: 1.16677 Bid: 1.16673 Ask Volumes: 7.01 Bid volumes: 1.12 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16678 Bid: 1.16672 Ask Volumes: 10.87 Bid volumes: 1.95 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16679 Bid: 1.16671 Ask Volumes: 15.58 Bid volumes: 9.97 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.1668 Bid: 1.1667 Ask Volumes: 51.17 Bid volumes: 46.4 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16681 Bid: 1.16669 Ask Volumes: 15.0 Bid volumes: 30.0 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16682 Bid: 1.16668 Ask Volumes: 3.75 Bid volumes: 25.3 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16684 Bid: 1.16666 Ask Volumes: 5.62 Bid volumes: 11.25 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16685 Bid: 1.16665 Ask Volumes: 9.37 Bid volumes: 3.75 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16687 Bid: 1.16664 Ask Volumes: 5.62 Bid volumes: 7.5 Total Ask Volume: 186.56 Total Bid Volume: 199.51
Ask: 1.16688 Bid: 1.16663 Ask Volumes: 62.57 Bid volumes: 62.27 Total Ask Volume: 186.56 Total Bid Volume: 199.51

Image

Attached simple strategy for testing


Attachments:
TickStrategy.java [1.79 KiB]
Downloaded 178 times
MarketDepth.JPG [96.55 KiB]
Downloaded 307 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Sat 26 May, 2018, 18:51 

User rating: 4
Joined: Wed 23 May, 2018, 20:08
Posts: 44
Location: FinlandFinland
.


 
 Post subject: Re: JForex 3 SDK: Market Depth. Post rating: 0   New post Posted: Mon 28 May, 2018, 16:45 

User rating: 4
Joined: Wed 23 May, 2018, 20:08
Posts: 44
Location: FinlandFinland
Hello,

Thank you the code you gave me was the best code ever!

EDIT
:
    public void onTick(Instrument instrument, ITick tick) throws JFException {
        if (instrument != this.instrument) {
            return;
        }
       
        double A = tick.getTotalAskVolume();
        double B = tick.getTotalBidVolume()   
        console.getOut().println("ASK: " + A + " BID: "  + B);
 }


This did not work on the Historical tester, but it works on Live Demo. In Historical Tester tick.getTotalAskVolume() gives me value for each tick, not total Ask Volume.
Can you tell me why, please?

EDIT: In attached picture you see how it looks on multiple currencies, not right at all. It gives correct amount on single currency. Could this be my internet connection? Can you tell me, please?



Best Regards & With Gratitude,
NightOwl.
Image


Attachments:
ef.PNG [18.36 KiB]
Downloaded 285 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com