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.

Discrepancy alligator ind. api vs. char?
 Post subject: Discrepancy alligator ind. api vs. char? Post rating: 0   New post Posted: Mon 15 Nov, 2010, 00:07 

User rating: 0
Joined: Wed 14 Apr, 2010, 22:36
Posts: 11
Hello,
I wanted to get to know to the alligator indicator and called it in a test strategy by
double[] alligator = context.getIndicators().alligator(instrument,
period,
OfferSide.BID,
IIndicators.AppliedPrice.CLOSE,
JAW_TIME_PERIOD,
TEETH_TIME_PERIOD,
LIPS_TIME_PERIOD,
1);

with JAW_TIME_PERIOD = 13, TEETH_TIME_PERIOD = 8 and LIPS_TIME_PERIOD = 5. Instrument = USD/JPY and Period = daily.
I ran the strategy for USD/JPY daily starting at 1st Jan. 2010.
For the 3rd Jan. 2010 I get the following values:
alligator[0] = 91,24
alligator[1] = 91,88
alligator[2] = 92,36
but on the chart the following values are displayed:
alligator[0] = 90,114
alligator[1] = 90,987
alligator[2] = 91,895
An image of the relevant chart image is attached (3rd Jan. is in Magenta, horizontal lines indicate values). Source code is attached too.
My chart preferences are 'Flats Filter is disabled' and 'Sunday Daily Candles Filter is disabled'.

What did I wrong? Modifying the shift -/+ 1 or modifying the checkboxes in the preferences don't lead to relevant corrections.

Many thanks in advance!


Attachments:
AlligatorStrategy.java [3.52 KiB]
Downloaded 373 times
Chart_USD_JPY_Daily_snapshot.2010.png [24.66 KiB]
Downloaded 438 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.
 
 Post subject: Re: Discrepancy alligator ind. api vs. char? Post rating: 0   New post Posted: Mon 15 Nov, 2010, 21:58 

User rating: 0
Joined: Wed 14 Apr, 2010, 22:36
Posts: 11
Problem solved! The three values of the alligator are 8, 5 and 3 days moved into future.
I checked that, everything is fine!


 

Jump to:  

cron
  © 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