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.

Filter weekends
 Post subject: Filter weekends Post rating: 0   New post Posted: Sat 04 May, 2013, 12:23 

User rating: 0
Joined: Thu 01 Mar, 2012, 10:59
Posts: 5
Location: NetherlandsNetherlands
Hello,

Would you please help me with a small question I have.
I'm using the indicators.ht_dcperiod in my strategy. I want the indicator to use the Filter.WEEKENDS. But in order to do this I have to make an array?
double[] ht_dcperiod(Instrument instrument, Period period, OfferSide side, IIndicators.AppliedPrice appliedPrice, Filter filter,long from,long to) throws JFException

When the ht_dcperiod gets to high or to low the strategy doesn't open any trades.
But with an array I get an error when I use the symbols < >. Example:
if (ht_dcperiod > 20) {

This gives an error.
How do I get around this?


 
 Post subject: Re: Filter weekends Post rating: 0   New post Posted: Sat 04 May, 2013, 17:47 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi Holland:

You can filter weekends using the filter paramenter... you can use the values present here -> https://www.dukascopy.com/client/javadoc ... ilter.html. Something like "Filter.WEEKENDS".

Regarding your second question, you are trying to compare one array of doubles with some value... you need to compare with one or some of the returning values of the array of doubles, something like "if (ht_dcperiod[x] > 20)" where x can be zero till max lenght of the array minus one. You need to compare with the one value of the array that have interess for you.

I hope that helps

Trade well

JL


 
 Post subject: Re: Filter weekends Post rating: 0   New post Posted: Sun 05 May, 2013, 18:50 

User rating: 0
Joined: Thu 01 Mar, 2012, 10:59
Posts: 5
Location: NetherlandsNetherlands
Thank you very much.


 
 Post subject: Re: Filter weekends Post rating: 0   New post Posted: Sun 05 May, 2013, 21:00 

User rating: 0
Joined: Thu 01 Mar, 2012, 10:59
Posts: 5
Location: NetherlandsNetherlands
One more question:
When using the Filter option you also have to use a time interval.
Can someone please tell me what the standard time interval is for the indicator ht_dcperiod?
From - start time of the first candle in the calculated period.
To - start time of the last candle in the calculated period.


 
 Post subject: Re: Filter weekends Post rating: 0   New post Posted: Sun 05 May, 2013, 21:21 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi Holland:

From Javadoc is more descriptive, i think that answers your question:

ht_dcperiod

double[] ht_dcperiod(Instrument instrument,
Period period,
OfferSide side,
IIndicators.AppliedPrice appliedPrice,
Filter filter,
long from,
long to)
throws JFException
Calculates the Hilbert Transform - Dominant Cycle Period indicator for ticks or bars in the specified period. For ticks bars with 1 second period are calculated first using the side specified in the side parameter, resulting data is calculated from these bars. The resulting array for ticks is an array of values for 1 second bars.
Parameters:
instrument - instrument of the bar
period - period of the bar
side - Bid or Ask side of the bar
appliedPrice - type of input data
filter - filter
from - start of the time interval for which bars or ticks should be loaded. The value must be equal to the exact starting time of the bar for the specified period. Method IHistory.getBarStart(Period, long) returns the starting time of the bar that includes the specified time
to - end time of the time interval for which bars or ticks should be loaded. This is the starting time of the last bar/tick that should be loaded

Returns:
values for the specified bars
Throws:
JFException - when parameters are not valid
See Also:
Indicator calculation

Trade well

JL


 
 Post subject: Re: Filter weekends Post rating: 0   New post Posted: Wed 08 May, 2013, 07:55 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Holland wrote:
One more question:
When using the Filter option you also have to use a time interval.
Can someone please tell me what the standard time interval is for the indicator ht_dcperiod?
From - start time of the first candle in the calculated period.
To - start time of the last candle in the calculated period.


Also, you can take a look on the following wiki page, which describes (with pictures) the different call methods:
https://www.dukascopy.com/wiki/#Indicato ... e_interval


 

Jump to:  

  © 1998-2026 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