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.

Strategy behavior?
 Post subject: Strategy behavior? Post rating: 0   New post Posted: Thu 24 Sep, 2009, 16:35 

User rating: 0
Joined: Wed 08 Jul, 2009, 00:42
Posts: 14
Backtesting a strategy based on daily bars and once filled I set a stop and take profit with the api. What I see on the report however, is that my position is closed at the same time each day regardless of if it is the take profit or stop. Here's a section example:

009-06-04 00:00:00 Order submitted Order [euus2, EUR/USD, BUY, 100000.0 at 0.0] submitted by the strategy
2009-06-04 00:00:00 Order filled Order [euus2, EUR/USD, BUY, 100000.0 at 1.4144] filled
2009-06-04 09:00:00 Order closed Order [euus2, EUR/USD, BUY, 100000.0 at 1.4144] closed by stop loss event, amount 100000.0 at 1.407
2009-06-04 21:00:00 Commissions Commissions [5.08]
2009-06-05 00:00:00 Order submitted Order [euus3, EUR/USD, BUY, 100000.0 at 0.0] submitted by the strategy
2009-06-05 00:00:00 Order filled Order [euus3, EUR/USD, BUY, 100000.0 at 1.41695] filled
2009-06-05 09:00:00 Order closed Order [euus3, EUR/USD, BUY, 100000.0 at 1.41695] closed by take profit event, amount 100000.0 at 1.42675
2009-06-05 21:00:00 Commissions Commissions [5.12]

As the backtester is simulating the effect of a real-time execution, I imagine something is at play here, but I would have hoped that the report time represented the actual time of the historic tick-price that closed the position.

Also, there doesn't seem to be much relationship between the closed price and the open when considering my stop/takeprofit value considering these will be activated by tick-data on the server?

Could you please clarify the situation please.


 
 Post subject: Re: Strategy behavior? Post rating: 0   New post Posted: Fri 25 Sep, 2009, 08:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
if you want real time execution, then you should select "ticks" time period, else the ticks will be generated from selected candles using interpolation method. Let's say if you select daily candles and "4 tick at OHLC" interpolation, then you will have only 4 ticks a day. As take profits and stop losses are checked and executed only at tick times, you will have execution times like 9:00


 

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