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.

Close order at the end of the day
 Post subject: Close order at the end of the day Post rating: 0   New post Posted: Sat 22 Jun, 2013, 13:11 
User avatar

User rating: 2
Joined: Mon 10 Dec, 2012, 22:04
Posts: 19
Location: India, Baroda
To Jforex Support,

I want to close the open order at the end of the day. Plz suggest the method or provide a code snippet or provide a Jforex wiki link. I searched Jforex wiki but I couldn't find such a method.

Regards,

B_Positive.


 
 Post subject: Re: Close order at the end of the day Post rating: 0   New post Posted: Sat 22 Jun, 2013, 20:18 
User avatar

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

The simplest way to do that is filter the daily candle on onBar() method, and on each new candle close the order:

if (period == Period.DAILY){
    for (Iorder order : engine.getOrders()) {
        order.close();
    }

}


Hope that helps

Trade well

JL


 
 Post subject: Re: Close order at the end of the day Post rating: 0   New post Posted: Sat 29 Jun, 2013, 17:26 

User rating: 0
Joined: Mon 19 Dec, 2011, 14:21
Posts: 12
Location: SwitzerlandSwitzerland
Hello,

I would like to close all open orders at 16h00 GMT and don't find the code to put this in my strategy . Can you provide some help ?
The strategy is in attachment.
Thanks


Attachments:
CCI.java [13.58 KiB]
Downloaded 352 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: Close order at the end of the day Post rating: 0   New post Posted: Mon 01 Jul, 2013, 07:41 
User avatar

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


 

Jump to:  

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