Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3078 MAX indicator
 Post subject: JFOREX-3078 MAX indicator Post rating: 0   New post Posted: Thu 30 Jun, 2011, 16:01 

User rating: -
Hi,

I am coding an strategy and trying to test it. I try to use the MIN and MAX indicators. I want to look for those values on the last let's say 40 candles (ONE_HOUR period). It works with live data properly, but when I use the backtester it doesn´t get those data, it always gives back a MIN or MAX which is much closer to the price than 40 hours. How can I fix it?

Thanks


 
 Post subject: Re: PROBLEMS WITH BACKTESTING Post rating: 0   New post Posted: Thu 30 Jun, 2011, 16:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
If you are just comparing your values to the ones on the chart mind that you have to adjust the timezone to GMT. See:
https://www.dukascopy.com/wiki/index.php ... _Date/Time
If this is not the problem's cause, please provide a fragment of your source code which works with the indicator values.


 
 Post subject: Re: PROBLEMS WITH BACKTESTING Post rating: 0   New post Posted: Thu 30 Jun, 2011, 16:29 

User rating: -
It works live, so I don´t think that there is a problem with the time zone. It works properly if I change time period to 5 MIN. The line is

a=this.indicators.max(instrument, Period.ONE_HOUR, OfferSide.ASK, IIndicators.AppliedPrice.HIGH, 40,0);

It gives me the max value in a period of less of 10 candles.

Thanks.

PD: If still you think that the problem could be the time zone could you please give me the piece of code to attach to the strategy and where should I attach it provided that I'm in Spain (My time is 2 hours more that the time of the platform)

Thanks again


 
 Post subject: Re: PROBLEMS WITH BACKTESTING Post rating: 0   New post Posted: Thu 30 Jun, 2011, 16:31 

User rating: -
PS: The way I'm comparing them is plotting the donchian channel indicator on the chart.


 
 Post subject: Re: PROBLEMS WITH BACKTESTING Post rating: 0   New post Posted: Thu 30 Jun, 2011, 19:48 

User rating: -
Why should time zone have importance when using 1H candles? I would understand that that would make a difference if we use daily candles, but 1H? When I use 5 MIN candles it works OK. I thought that maybe the tester doesn´t go back 40 hours to look for past values.

The code that I use to get this value is:

A=this.indicators.max(instrument, Period.ONE_HOUR, OfferSide.ASK, IIndicators.AppliedPrice.HIGH, 40,0);

ANd I run it with every 1H candle. The values I use to check it are those from indicator Donchian Channel 40. It works properly as I said when I use live data or with 5 MIN candles anyway.

If you think that is a time zone problem, please let me know the piece of code that I need to add to avoid me use the backtester.

Thanks a lot,


 
 Post subject: Re: PROBLEMS WITH BACKTESTING Post rating: 0   New post Posted: Thu 30 Jun, 2011, 20:21 

User rating: 0
Joined: Thu 30 Jun, 2011, 20:11
Posts: 41
Location: Spain,
I answered several times, but I think I was not logged in. I try again:

Why should time zone affect if we are using 1H candles? I would understand it if we use 1D candles since opening and closing levels change with beginning of the day, but that is not relevant with 1H candles, is it?

It works OK with live data and with 5 MIN candles both with live data and with the backtester. I thought that maybe the tester doesn´t go 45 hours back to get the data.

Anyway if you think that it is a time zone problem, please let me know the piece of code that I should add provided that I trade from Spain, 2 hours difference with the platform.

The code that I use is calling the next line with every 1H candle:

a=this.indicators.max(instrument, Period.ONE_HOUR, OfferSide.ASK, IIndicators.AppliedPrice.HIGH, 45,0);

And I am comparing it with the lines displayed by the Donchian Channels Indicator with timeperiod 45.

Thanks a lot.


 

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