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.

fastest access to Tick values
 Post subject: fastest access to Tick values Post rating: 0   New post Posted: Thu 08 Nov, 2012, 16:39 

User rating: 0
Joined: Tue 16 Oct, 2012, 06:03
Posts: 3
Hi Dukascopy Community
I have question concerning the fastest access to tick data. I am going to do some scalping and I am wondering if my thinking is right:
Of course after prior subscription to the instrument While in onTick I am filtering data:

if (instrument == Instrument.EURGBP )


than I try to do some things and question appears:
Is there a possibility to write to variable current value of bid and ask side?

Or maybe there is faster way for example:
history.getLastTick(Instrument.EURUSD).getAsk()

My point is just to get the faster access for computations to the current values on the market.

Could you please advise me what is the best way to achieve this?

Regards


 
 Post subject: Re: fastest access to Tick values Post rating: 0   New post Posted: Fri 09 Nov, 2012, 11:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The fastest way is to fetch the tick from the onTick method as it gets called every time a new tick arrives.


 
 Post subject: Re: fastest access to Tick values Post rating: 0   New post Posted: Fri 09 Nov, 2012, 11:17 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
public void onTick(Instrument instrument, ITick tick) throws JFException
{

}

You don`t have to ask for a tick, as it is already there (the tick parameter of the function is always the latest tick).


 
 Post subject: Re: fastest access to Tick values Post rating: 0   New post Posted: Wed 14 Nov, 2012, 07:23 

User rating: 0
Joined: Tue 16 Oct, 2012, 06:03
Posts: 3
Thank you for answer.
What if the strategy includes playing on two pairs, for example eurusd and audjpy. In such situation strategy needs to know what is the last tick of each of those two.
For one of those you've already explained, but how to get the value of last tick of second currency pair?

To be clear please find described situation below:

public void onTick(Instrument instrument, ITick tick) throws JFException {
if (instrument == Instrument.EURUSD){
Some computation with last values of eurusd and audjpy;
}
if (instrument == Instrument.AUDJPY){
Some computation with last values of eurusd and audjpy;
}
}

Regards


 
 Post subject: Re: fastest access to Tick values Post rating: 0   New post Posted: Wed 14 Nov, 2012, 09:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
in that case use ITick.getLastTick.


 

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