Dukascopy
 
 
Wiki JStore Search Login

Problem with getOrderHistory() method
 Post subject: Problem with getOrderHistory() method Post rating: 0   New post Posted: Tue 16 Oct, 2012, 13:14 

User rating: 0
Joined: Tue 16 Oct, 2012, 13:10
Posts: 17
Location: Russian FederationRussian Federation
I've piece of code, that isn't working(expert advisor hangs) when period = Period.Monthly:

 Calendar from = Calendar.getInstance();   
        from.setTimeZone(TimeZone.getTimeZone("GMT"));
        from.setTimeInMillis (time);
        if ( period == Period.DAILY )
            from.roll(Calendar.DAY_OF_YEAR, -1);     
        else if ( period == Period.WEEKLY )
            from.roll(Calendar.DAY_OF_YEAR, -7);
        else if ( period == Period.MONTHLY )
            from.roll(Calendar.DAY_OF_YEAR, -30);
        Calendar to = Calendar.getInstance();
        to.setTimeZone(TimeZone.getTimeZone("GMT"));
        to.setTimeInMillis (time);               
       
        java.util.List<IOrder> orders = this.context.getHistory().getOrdersHistory(this.instrument, from.getTimeInMillis(), to.getTimeInMillis());


When I'm using the:
else if ( period == Period.MONTHLY )
            from.roll(Calendar.DAY_OF_YEAR, -15);


The expert adsvisor is works, but I'm really need the orders history for the last month(not half month).

Please consider this report and help me to solve the problem.


 

Jump to:  

  © 1998-2024 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