|
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.
Strategy Parabolic Sar |
abaaa07
|
Post subject: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Tue 27 Nov, 2012, 04:41
|
|
User rating: 0
Joined: Mon 19 Nov, 2012, 08:31 Posts: 4
|
Hello Support,
I want traslate from C# this code:
Only for Range Bars (Parameter), Calculate signals on bar close or Tick.
Signal Buy:
if (High[0] > ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] && ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] > ParabolicSAR(Open, 0.02, 0.2, 0.02)[0] && ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] < High[0] && High[1] < Bollinger(2,14).Upper[2]) ) {
DrawArrowUp("My up arrow" + CurrentBar, false, 0, Low[0], Color.Cyan); Alert("Bull Alert", Priority.High, "Bull Breakout", "Alert2.wav", 100000, Color.White, Color.Blue); }
Signal Sell:
if (Low[0] < ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] && ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] < ParabolicSAR(Open, 0.02, 0.2, 0.02)[0] && ParabolicSAR(Open, 0.02, 0.2, 0.02)[1] > Low[0] && Low[1] > Bollinger(2,14).Lower[2]) ) { DrawArrowDown("My down arrow" + CurrentBar, false, 0, High[0], Color.Red); Alert("Bull Alert", Priority.High, "Bull Breakout", "Alert2.wav", 100000, Color.White, Color.Blue); }
Regards.
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Tue 27 Nov, 2012, 09:16
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
abaaa07
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 08:48
|
|
User rating: 0
Joined: Mon 19 Nov, 2012, 08:31 Posts: 4
|
Hello,
Is there any example to see strategies range bars that use indicators Parabolic Sar or Bollinger Bands.
My knowledge of English is limited and I'm a little confused.
Regards.
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 09:22
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
abaaa07
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 09:53
|
|
User rating: 0
Joined: Mon 19 Nov, 2012, 08:31 Posts: 4
|
Example how to get a previous bar awesome values using 3 special bband methods and one universal calculateIndicator method. First we need to initialize necessary fields:
private static int timePeriod = 14; private static double nbDevDn = 2; private static double nbDevUp = 2; MaType maType = MaType.EMA;
Object[] bbandsUniversal = indicators.calculateIndicator(feedDescriptor, new OfferSide[] {OfferSide.BID}, "BBANDS", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[]{timePeriod, nbDevUp, nbDevDn, MaType.EMA.ordinal()}, 1);
The sentence MaType maType = MaType.EMA show error, why??
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 10:28
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
It is not clear what you mean, please provide full example strategy.
|
|
|
|
 |
abaaa07
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 10:51
|
|
User rating: 0
Joined: Mon 19 Nov, 2012, 08:31 Posts: 4
|
I try get last bar bollinger bands indicator values (Upper Band, Middle Band, Lower Band) using universal method, but this not compile:
Object[] bbandsUniversal = indicators.calculateIndicator(instrument, timePeriod, new OfferSide[] {OfferSide.BID}, "BBANDS", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[]{timePeriod, nbDevUp, nbDevDn, MaType.EMA.ordinal()}, 1);
Attachments: |
FeedEmaMacdMinMax.java [7.65 KiB]
Downloaded 296 times
|
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
|
|
|
|
|
 |
API Support
|
Post subject: Re: Strategy Parabolic Sar |
Post rating: 0
|
Posted: Fri 30 Nov, 2012, 11:36
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
You need to add an import: import com.dukascopy.api.IIndicators.MaType;
In order to avoid such compile-time errors, consider using an IDE, For example Eclipse or NetBeans.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|