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.

pivot S1S2S3 & R1R2R3
 Post subject: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Thu 10 Mar, 2011, 07:47 

User rating: 0
Joined: Sun 20 Feb, 2011, 21:34
Posts: 10
Hi.

I'd like to quote pivot support1,2,3 & resistance1,2,3 lines.

But I couldn't detect them in IIndicators.(Only "double[][] pivot()" etc were found.)

Please teach me how to invite them to my strategy.


Thank you.


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Tue 22 Mar, 2011, 10:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
The following code may be helpful:
 double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.ONE_HOUR , OfferSide.ASK, 5, false, 1);
 console.getOut().println("Central Point (P): " + pivotValues[0]);
 console.getOut().println("Resistance (R1): " + pivotValues[1]);
 console.getOut().println("Support (S1): " + pivotValues[2]);
 console.getOut().println("Resistance (R2): " + pivotValues[3]);
 console.getOut().println("Support (S2): " + pivotValues[4]);
 console.getOut().println("Resistance (R3): " + pivotValues[5]);
 console.getOut().println("Support (S3): " + pivotValues[6]); 


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Tue 22 Mar, 2011, 13:04 

User rating: 0
Joined: Sun 20 Feb, 2011, 21:34
Posts: 10
Thank your reply support.

It's presumptuous of me.
I think IIndicators & other API needs to be explained more.

I hope for your job.

Best regards.


higebouzu :D


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Mon 09 May, 2011, 18:43 

User rating: 0
Joined: Tue 28 Sep, 2010, 08:00
Posts: 10
Location: Berlin
Hi Support - hi pivot-user!

Can you please explain, how to calculate Daily Pivot Points.

With using
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.ONE_HOUR , OfferSide.ASK, 5, false, 1);

i get an error with Period.DAILY, that hourly is the highest.
And what function has the parameter "timeframe = 5"?

Thanks very much in advance


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Tue 10 May, 2011, 07:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Try the following:
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.DAILY, OfferSide.ASK, 7, false, 1);


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Tue 10 May, 2011, 08:39 

User rating: 0
Joined: Tue 28 Sep, 2010, 08:00
Posts: 10
Location: Berlin
Hi!

With the new version all items of the return array have the same value???

Is there a way to see the calculation in detail?

And what is the meaning of the "7" (timeperiod) compared to Period.DAILY


Thanks!


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Tue 10 May, 2011, 19:31 

User rating: -
Hi,

do we have middle lines of pivot points in indicators list?
I can't find them

I mean S 0.5, 1.5 , 2.5 and R 0.5 , 1.5 , 2.5 ?

If no, why? sometimes is helpful

Thanks!


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Wed 11 May, 2011, 07:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
letthemachineswork wrote:
With the new version all items of the return array have the same value???

No, they don't, please consider the following code:
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.DAILY , OfferSide.ASK, 7, false, 1);
console.getOut().println("Central Point (P): " + pivotValues[0]);
console.getOut().println("Resistance (R1): " + pivotValues[1]);
console.getOut().println("Support (S1): " + pivotValues[2]);
console.getOut().println("Resistance (R2): " + pivotValues[3]);
console.getOut().println("Support (S2): " + pivotValues[4]);
console.getOut().println("Resistance (R3): " + pivotValues[5]);
console.getOut().println("Support (S3): " + pivotValues[6]); 


letthemachineswork wrote:
Is there a way to see the calculation in detail?
And what is the meaning of the "7" (timeperiod) compared to Period.DAILY

You can download Pivot indicator source code with JForex Client Library (https://www.dukascopy.com/swiss/english/ ... x/library/)
If you look inside the code you'll see the following:
...
int[] periodValues = new int[10];
String[] periodNames = new String[10];
periodValues[0] = 0;
periodNames[0] = "1 Min";
periodValues[1] = 1;
periodNames[1] = "5 Mins";
...
periodValues[7] = 7;
periodNames[7] = "Daily";
...

7 ("Daily") is the value of Pivot's optional parameter.


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Mon 16 May, 2011, 13:33 

User rating: 0
Joined: Tue 28 Sep, 2010, 08:00
Posts: 10
Location: Berlin
just to whom who may concern: as far as I found out is the critical thing the bar offset on mondays:

use tuesday to friday (the API will automaticly use the previous day - so you have to take the active day bar "0"):
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.DAILY , OfferSide.ASK, 7, false, 0);


on monday (have to take the saturday-bar - "2"):
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.DAILY , OfferSide.ASK, 7, false, 2);


 
 Post subject: Re: pivot S1S2S3 & R1R2R3 Post rating: 0   New post Posted: Thu 26 May, 2011, 09:43 

User rating: 0
Joined: Thu 26 May, 2011, 09:32
Posts: 2
Location: Germany,
Hi,

I've tried the proposed code:
double[] pivotValues = indicators.pivot(Instrument.EURUSD, Period.DAILY , OfferSide.ASK, 7, false, 1);

but I receive the following error at the compilation:
The method pivot(Instrument, Period, OfferSide, int, int) in the type IIndicators is not applicable for the arguments (Instrument, Period, OfferSide, int, boolean, int)

To note: I've used the Strategytester in the Live Account 'JForex API ver. 2.6.33'

Thanks for your help.


 

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