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.

Strange values from minMax Indicator
 Post subject: Strange values from minMax Indicator Post rating: 0   New post Posted: Mon 24 Jun, 2013, 18:52 
User avatar

User rating: 0
Joined: Mon 24 Jun, 2013, 01:13
Posts: 3
Location: GermanyGermany
Hello,

I am pretty new to JForex, however I am an experienced Java Programmer, so there is actually no syntactical problem with the API. What really troubles me are the results I get from the minMAx Indicator.

This is what I wrote:
Instrument instrument = Instrument.EURUSD;
double[] minmax = null;
IIndicators indicators = context.getIndicators();
minmax = indicators.minMax(instrument, Period.ONE_HOUR, OfferSide.ASK, AppliedPrice.HIGH, 55, 1);
console.getOut().println("Min: " + minmax[0] + " Max: " + minmax[1]);


As I see it, I should get the highest value of the last 55hrs as minmax[1]. But when I check the charts, it is the highest value of the last eight hours with obvious higher values around 10 hrs before. What is the catch here? I tried to figure it out by myself, but I am lost. Maybe you folks can help me, I really appreciate it.
Thank you very much in advance
Tag


 
 Post subject: Re: Strange values from minMax Indicator Post rating: 0   New post Posted: Tue 25 Jun, 2013, 07:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Chances are that the chart uses a different Filter than the one you use from the API, see:
https://www.dukascopy.com/wiki/#Indicator_usage_checklist


 
 Post subject: Re: Strange values from minMax Indicator Post rating: 0   New post Posted: Tue 25 Jun, 2013, 12:42 
User avatar

User rating: 0
Joined: Mon 24 Jun, 2013, 01:13
Posts: 3
Location: GermanyGermany
Well,
I started using another method of the indicators class - namely:
long prevBarTime = history.getBar(instrument, Period.THIRTY_MINS, OfferSide.ASK, 1).getTime();
double[][] maxArray = indicators.minMax(instrument, Period.ONE_HOUR, OfferSide.ASK, AppliedPrice.HIGH, 55, Filter.WEEKENDS, prevBarTime, prevBarTime);


I guess, because I tested it on a monday, the weekend was also considered by the minmax algorithm, which didn't show on the chart. So I am using the above method in which I started to use the Filter.WEEKENDS field as well. The method itself is a little tricke because of the bartimes you have to take in consideration as well - and it gives you for no obvious reason a two-dimensional array in return. But who cares, it seems to work.

Thank you very much for your help, I really appreciated it.


 

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