|
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.
| Regarding Awesome Oscillator |
|
B_Positive
|
| Post subject: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Tue 23 Apr, 2013, 21:07
|
|
User rating: 2
Joined: Mon 10 Dec, 2012, 22:04 Posts: 19 Location: India, Baroda
|
|
To Jforex Support,
I wanted to code a strategy using Awesome Oscillator. The basic strategy is like this -
If the color of the histogram is GREEN, a BUY position is opened. If the color of the histogram is RED, a SELL position is opened.
I have coded the whole strategy except for this logical part coz I don't know how to code the condition for 'change of color'.
Please tell me how should I code this strategy.
B_Positive.
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Wed 24 Apr, 2013, 09:26
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
|
 |
|
B_Positive
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Wed 24 Apr, 2013, 23:27
|
|
User rating: 2
Joined: Mon 10 Dec, 2012, 22:04 Posts: 19 Location: India, Baroda
|
To Jforex Support, I referred to the links that you provided & tried to code the strategy. I used the awesome oscillator in the logic in the following way - double[] awesome1 = indicators.awesome(instrument, selectedPeriod1, offerSide, appliedPrice, MAPeriod, MAType1, 1, MAType1, 0);
if (awesome1[2] > awesome1[1] && awesome1[1] < awesome1[0]) { if (order == null || !order.isLong()) { closeOrder(order); order = submitOrder(OrderCommand.BUY, instrument); } } if (awesome1[2] < awesome1[1] && awesome1[1] > awesome1[0]) { if (order == null || order.isLong()) { closeOrder(order); order = submitOrder(OrderCommand.SELL, instrument); } }
But I am not getting the expected result. I want to define the awesome oscillator with the time periods of 5 and 34. But in the definition for awesome oscillator, only one time period is included. How should I include the other one? Also, if there is any other mistake, please point it out. B_Positive
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Thu 25 Apr, 2013, 08:57
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
|
 |
|
B_Positive
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Thu 25 Apr, 2013, 20:22
|
|
User rating: 2
Joined: Mon 10 Dec, 2012, 22:04 Posts: 19 Location: India, Baroda
|
To Jforex Support, I changed the definition of the awesome oscillator to the following : double[] awesome1 = indicators.awesome(Instrument.EURUSD, Period.FIVE_MINS, OfferSide.BID, AppliedPrice.CLOSE, 5, MaType.SMA, 34, MaType.SMA, 0);
Also, I added logging statements to see what execution paths get taken as suggested by you and I got the following results : Quote: 19:15:40 1-dimensional indicator result array: [0] 0.00000; [1] NaN; [2] -0.00015;
I do not understand what this means. Please explain. I have kept the rest of the logic same. B_Positive.
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Fri 26 Apr, 2013, 07:25
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
Please provide full example strategy, explain what results you expect and what you receive instead.
|
|
|
|
|
 |
|
B_Positive
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Sat 27 Apr, 2013, 09:08
|
|
User rating: 2
Joined: Mon 10 Dec, 2012, 22:04 Posts: 19 Location: India, Baroda
|
To Jforex Support, As asked by you, I am attaching the awesome oscillator strategy, its historical testing results, the logging values strategy, the diagram showing what I expect from the awesome oscillator strategy. The historical testing results show no trade taken.  B_Positive.
| Attachments: |
Awesome_Strategy.java [8.1 KiB]
Downloaded 342 times
|
LoggingValues.java [2.47 KiB]
Downloaded 337 times
|
Results.docx [190.31 KiB]
Downloaded 341 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: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Tue 30 Apr, 2013, 12:35
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
You should insert the logging statements inside your strategy such that you see which execution paths get taken and why they don't lead to submitting orders, for instance: double[] awesome1 = indicators.awesome(instrument, selectedPeriod, offerSide, appliedPrice, FasterMAPeriod, MAType1, SlowerMAPeriod, MAType1, 0); console.getOut().format("awesome=%s isBuy? %s isSell? %s is order null? %s is order long? %s", Arrays.toString(awesome1), awesome1[2] > awesome1[1] && awesome1[1] < awesome1[0], awesome1[2] < awesome1[1] && awesome1[1] > awesome1[0], order == null, order == null ? "-" : order.isLong() ).println();
|
|
|
|
|
 |
|
B_Positive
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Tue 30 Apr, 2013, 16:29
|
|
User rating: 2
Joined: Mon 10 Dec, 2012, 22:04 Posts: 19 Location: India, Baroda
|
|
To Dukascopy Support,
I inserted the logging statements in the loggingvalues strategy as suggested by you but while running the strategy it shows the following error :
2013-04-30 15:22:40 java.util.MissingFormatArgumentException: Format specifier 's' @ jforex.LoggingValues.onStart(LoggingValues.java:32)
Please tell me what this means.
Regards,
B_Positive.
|
|
|
|
|
 |
|
API Support
|
| Post subject: Re: Regarding Awesome Oscillator |
Post rating: 0
|
Posted: Tue 30 Apr, 2013, 16:36
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|