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.

How to fetch last tick of Friday
 Post subject: How to fetch last tick of Friday Post rating: 0   New post Posted: Mon 18 Mar, 2013, 20:34 
User avatar

User rating: 0
Joined: Mon 02 Apr, 2012, 09:22
Posts: 12
Location: United Kingdom, London
To Dukascopy Support,

Kindly tell me how to fetch the last tick of Friday when the market re-opens on Sunday.

Regards,

Terry.


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Mon 18 Mar, 2013, 21:16 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi Terry:

You can do that with the examples provided on Dukascopy Wiki here

Trade well

JL


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Tue 19 Mar, 2013, 05:32 
User avatar

User rating: 0
Joined: Mon 02 Apr, 2012, 09:22
Posts: 12
Location: United Kingdom, London
To Jlongo,

Sorry but I don't think this answers my query. The methods suggested by you only fetch the last tick, the last tick by shift and the last tick by adding date and time. I want to fetch the last tick of the previous week in the current week and I may have to fetch it at various times during the whole current week.

Please suggest a way to do that.

Regards,

Terry.


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Tue 19 Mar, 2013, 06:06 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi Terry:

if you try with something like:

List<ITick> ticks = history.getTicks(Instrument.EURUSD, friday_close_time_minus_some_time_just_in_case, friday_close_plus_some_time_just_in_case);
int last = ticks.size() - 1;
for  (x=last, x > 0, x--){
// find the last tick with volume
}


With this way you can get the last tick on friday getting all available ticks near the pre-time-close and plus-time-close i think. Don't know if there exists a better way.

Trade well

JL


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Tue 19 Mar, 2013, 08:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Market_Hours


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Tue 19 Mar, 2013, 12:27 
User avatar

User rating: 0
Joined: Mon 02 Apr, 2012, 09:22
Posts: 12
Location: United Kingdom, London
To Dukascopy Support,

I wish to fetch the last tick of Friday of previous week at any time during the current week. The link suggested by you only shows how to get past market offline times and check if the market is offline or not as per my understanding. Could you plz elaborate how these methods answer my query?

Regards,

Terry.


 
 Post subject: Re: How to fetch last tick of Friday Post rating: 0   New post Posted: Tue 19 Mar, 2013, 14:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
From market hours you can get the session end time. Take that end time and fetch ticks over the minute before that end time. From those ticks take the last tick and that will be the last tick of that trading session. Should you encounter any problems implementing the logic, please support your further inquiries with your example strategy.


 

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