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 close an order after X minutes
 Post subject: How to close an order after X minutes Post rating: 0   New post Posted: Fri 07 Oct, 2011, 17:34 

User rating: 0
Joined: Fri 07 Oct, 2011, 17:33
Posts: 1
Location: IT
Dear all,

could you a snippet of code to close an order after X minutes?
Thanks in advance


 
 Post subject: Re: How to close an order after X minutes Post rating: 0   New post Posted: Mon 10 Oct, 2011, 06:13 

User rating: 0
Joined: Thu 06 Oct, 2011, 06:08
Posts: 5
Location: DE
Here you go :)

        for (IOrder orderInMarket : engine.getOrders()) {
 
        if (order.getFillTime() + Minutes*60000 < tick.getTime()) {
            order.close();
        }
    }


 

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