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 write a time limit for an auto trading strategy?
 Post subject: How to write a time limit for an auto trading strategy? Post rating: 0   New post Posted: Fri 19 Sep, 2014, 06:38 
User avatar

User rating: 0
Joined: Fri 29 Mar, 2013, 17:33
Posts: 9
HI, may i ask a simple question?How to write a time limit in an auto trading strategy in remote server?
I means,for example,when time is at 2015-09-19,just running a year,then the stategy will not be excuted.
thanks for your help,i am not a coder,just very interesting in autotrading.


 
 Post subject: Re: How to write a time limit for an auto trading strategy? Post rating: 0   New post Posted: Fri 19 Sep, 2014, 07:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
robert3144 wrote:
How to write a time limit for an auto trading strategy?
https://www.dukascopy.com/wiki/#Strategy_API
https://www.dukascopy.com/wiki/#Strategy_Tutorial
robert3144 wrote:
How to write a time limit in an auto trading strategy in remote server?
I means,for example,when time is at 2015-09-19,just running a year,then the stategy will not be excuted.
https://www.dukascopy.com/wiki/#Customize_trading_hours
For things that you should be aware of when writing a Strategy which is meant to be run on the remote servers see:
https://www.dukascopy.com/wiki/#Remote_Run


 
 Post subject: Re: How to write a time limit for an auto trading strategy? Post rating: 0   New post Posted: Mon 06 Oct, 2014, 06:52 
User avatar

User rating: 1
Joined: Mon 27 Jan, 2014, 14:03
Posts: 7
Location: TaiwanTaiwan
This is what I did in onBar. Maybe putting it in onTick is also good:
         Iterator<IOrder> itr = engine.getOrders().iterator();
         while (itr.hasNext()) {
            IOrder odr = itr.next();
            double holdInterval = forwardLength * period.getInterval();
            if (odr.getState() == IOrder.State.FILLED
                  && LastTime - odr.getCreationTime() >= holdInterval) {
               odr.close();
            }
         }


 
 Post subject: Re: How to write a time limit for an auto trading strategy? Post rating: 0   New post Posted: Sat 18 Oct, 2014, 00:15 
User avatar

User rating: 0
Joined: Fri 29 Mar, 2013, 17:33
Posts: 9
many many 3KS,good man


 
 Post subject: Re: How to write a time limit for an auto trading strategy? Post rating: 0   New post Posted: Sat 18 Oct, 2014, 01:16 
User avatar

User rating: 0
Joined: Fri 29 Mar, 2013, 17:33
Posts: 9
can you help my another EA system?

viewtopic.php?f=65&t=51782


 

Jump to:  

cron
  © 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