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.

time period?
 Post subject: time period? Post rating: 0   Post Posted: Wed 12 Jun, 2013, 06:52 

User rating: 2
Joined: Fri 17 May, 2013, 06:58
Posts: 76
Location: SwedenSweden
Hi,

How does the time period work?

Example:
On https://www.dukascopy.com/wiki/#Strategy_Tutorial the time period is

@Configurable("SMA time period")
public int smaTimePeriod = 30;

Is this in relation to this value:

@Configurable(value="Period value")
public Period myPeriod = Period.TEN_MINS;

?

If so, does it mean that the SMA always will be based on 30 * 10 minutes?

Thanks in advance.

Kind Regards,
Henrik


 
 Post subject: Re: time period? Post rating: 0   Post Posted: Wed 12 Jun, 2013, 07:49 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No it does not - the Period class represents the timeframe over which the indicator gets calculated. But the timePeriod is an indicator-specific optional input which determines over how many bars the moving average get calculated (the smaller the number the "faster" the SMA and vice versa).


 
 Post subject: Re: time period? Post rating: 0   Post Posted: Wed 12 Jun, 2013, 09:07 

User rating: 2
Joined: Fri 17 May, 2013, 06:58
Posts: 76
Location: SwedenSweden
Hi again,

But in what unit is the '30' value measured? Is it 30 bars? If so, how long is a bar?

How should I do if I want to base my strategy on the 30 latest ticks?

Thanks.

/Henrik


 
 Post subject: Re: time period? Post rating: 0   Post Posted: Wed 12 Jun, 2013, 09:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Quote:
But in what unit is the '30' value measured? Is it 30 bars? If so, how long is a bar?
As "long" as the one that you pass in the Period (i.e. the second parameter) to the sma method.
Quote:
How should I do if I want to base my strategy on the 30 latest ticks?
See the last example in:
https://www.dukascopy.com/wiki/#Indicator_Calculation/Calculate_indicator_by_time_interval


 

Jump to:  

  © 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