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.

Usage of pivot indicator
 Post subject: Usage of pivot indicator Post rating: 0   New post Posted: Mon 08 Jul, 2013, 15:30 

User rating: 0
Joined: Sat 08 Jun, 2013, 12:05
Posts: 71
Location: FranceFrance
I'm not sure how to use timePeriod parameter of https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#pivot(com.dukascopy.api.Instrument,%20com.dukascopy.api.Period,%20com.dukascopy.api.OfferSide,%20int,%20int)

should it be used like this?
Quote:
double[] p = indicators.pivot(instrument,
Period.FIFTEEN_MINS, OfferSide.BID,
Period.DAILY.ordinal(), 0);


 
 Post subject: Re: Usage of pivot indicator Post rating: 0   New post Posted: Mon 08 Jul, 2013, 15:48 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No the timePeriod parameter does not match the Period constant value order, you should use the index of the given order in the javadocs - for Period.DAILY it will be 7.


 
 Post subject: Re: Usage of pivot indicator Post rating: 0   New post Posted: Mon 08 Jul, 2013, 22:52 

User rating: 0
Joined: Sat 08 Jun, 2013, 12:05
Posts: 71
Location: FranceFrance
right, (from typo ->)
value form 0 to 9 that describes the period used in the indicator. Periods are as follows: ONE_MIN, FIVE_MINS, TEN_MINS, FIFTEEN_MINS, THIRTY_MINS, ONE_HOUR, FOUR_HOURS, DAILY, WEEKLY, MONTHLY

I was just surprised that is was a bit harcoded there, but fine


 
 Post subject: Re: Usage of pivot indicator Post rating: 0   New post Posted: Tue 09 Jul, 2013, 12:34 

User rating: 0
Joined: Sat 08 Jun, 2013, 12:05
Posts: 71
Location: FranceFrance
I also get only 7 values and not the mid-points although it's written in docs they shold be returned:
values for the specified bar, outputs are returned in the following order: 
'Central Point (P)', 'Resistance (R1)', 'Support (S1)', 'Resistance (R2)', 'Support (S2)', 'Resistance (R3)', 'Support (S3)', 'Mid Point P-R1', 'Mid Point P-S1', 'Mid Point R1-R2', 'Mid Point S1-S2', 'Mid Point R2-R3', 'Mid Point S2-S3'
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#pivot(com.dukascopy.api.Instrument,%20com.dukascopy.api.Period,%20com.dukascopy.api.OfferSide,%20int,%20int)
is this a bug? anyway if it's just the average I can do it myself ;)


 
 Post subject: Re: Usage of pivot indicator Post rating: 0   New post Posted: Wed 10 Jul, 2013, 07:35 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide an example strategy which replicates the case.


 

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