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.

More periods for backtesting
 Post subject: More periods for backtesting Post rating: 0   New post Posted: Mon 27 May, 2013, 07:20 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
Hello!

You already told me about how to set up more periods (2h, 4h, ...).
When I use a @Configurable-Tag as period, I don't have those periods available.
Only the "normal" ones such as 4h, daily, weekly are selectable.

Please help...


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Mon 27 May, 2013, 07:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider using 2 parameters - one int and one Unit and then create the custom period in your strategy by using Period.createCustomPeriod


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Mon 27 May, 2013, 07:49 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
That's nice!

Thank you!

Is there an example available?


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Mon 27 May, 2013, 08:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For parameter declaration see:
https://www.dukascopy.com/wiki/#Strategy_parameters
If you encounter any problems in implementing the custom period usage, please provide an example strategy of yours.


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Tue 28 May, 2013, 14:15 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
Hello!

Unfortunately, this is not what I requested.
Would you be so kind as to provide an example how to set up a 2h period?

Thank you!


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Tue 28 May, 2013, 14:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
If you encounter any problems in implementing the custom period usage, please provide an example strategy of yours such that we can advise you how to fix them.


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Tue 28 May, 2013, 14:55 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
OK, there you go:

console.getOut().println(indicators.mama(Instrument.EURUSD, Period.createCustomPeriod(Unit.Hour, 2), OfferSide.BID, IIndicators.AppliedPrice.OPEN, 0.5, 0.3, 0)[0]);

Yields NaN.

console.getOut().println(indicators.mama(Instrument.EURUSD, Period.createCustomPeriod(Unit.Hour, 1), OfferSide.BID, IIndicators.AppliedPrice.OPEN, 0.5, 0.3, 0)[0]);

Does work!


 
 Post subject: Re: More periods for backtesting Post rating: 0   New post Posted: Tue 28 May, 2013, 14:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For indicator calculation on custom price feed see:
https://www.dukascopy.com/wiki/#Indicator_Calculation/Calculate_on_price_feed_by_shift


 

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