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.

How to determine highest high and lowest low
 Post subject: How to determine highest high and lowest low Post rating: 0   Post Posted: Fri 25 Jun, 2010, 13:05 

User rating: 0
Joined: Thu 27 Mar, 2008, 13:06
Posts: 18
Hello,

could you tell me, how I can determine highest high and lowest low for specific time period?
For example I know this value from GBPUSD from 00:00 to 7:30 CET

Thanks
DarkMan


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Mon 28 Jun, 2010, 09:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
You could write a strategy, that will do it for you. Give some input parameters, for example, instrument, period, start time and end time. Use an onBar method to check when to start and when to end collecting bar data. Then collect data. After the time is out, calculate the lowest and the highest value from your collected data. Calculated values you could store in some file.


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Mon 28 Jun, 2010, 11:14 

User rating: 0
Joined: Thu 27 Mar, 2008, 13:06
Posts: 18
Hello,

but I need find this values from history and I don't know how to do it.
If I start strategy after 7:30 I need determine Highest high and Lowest low, so collecting data in onBar isn't possible.

DarkMan


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Mon 28 Jun, 2010, 12:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is a method getBars in the IHistory. Consider this https://www.dukascopy.com/swiss/docs/interfaces/IHistory.htm
Use this method to get bars in that period of time. Write some function that will return you bars with the highest and the lowest value from the list of bars. Then use a list returned by getBars as an input parameter in your function.


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Tue 29 Jun, 2010, 14:50 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
"int iGetHigh(int rank)" and get low indicators that return the bar number (for plugging into iHistory) of the highest bar would be useful in the API. The parameter int rank could be to set highest, 2nd highest, 3rd highest, etc. bar that you want


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Sun 11 Jul, 2010, 20:23 

User rating: 0
Joined: Sun 11 Jul, 2010, 20:12
Posts: 20
OK I'm confused. I thought the IIndicators.max() and IIndicators.min methods do exactly that - ie find the highest high or lowest low over a given time period. Unfortunately it is very difficult to tell because the Javadocs include very little actual documentation.


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Tue 13 Jul, 2010, 09:01 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
its not the same. Indicators max/min represent min/max value for given period of time. It means that it will return you calculated maximum/minimum for last specified number of candles (which is Time Period).
On FRACTAL indicator information you can find here https://www.investopedia.com/articles/trading/06/Fractals.asp

All indicators that are implemented in the JForex is a standard FOREX indicators, on which information may be found in internet quite easily.


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Tue 13 Jul, 2010, 17:41 

User rating: 0
Joined: Sun 11 Jul, 2010, 20:12
Posts: 20
What? This makes no sense to me.

The Javadocs list the max function like this:

double max(Instrument instrument,
Period period,
OfferSide side,
IIndicators.AppliedPrice appliedPrice,
int timePeriod,
int shift)

It looks to me like it returns the single max value over the given timePeriod. Why is the max value over the given timePeriod different from the highest high (the highest value of any bar high) over the given time period? Seems to me like the same thing. Please explain.

Please note that I am saying that max() is the same as what Darkman was looking for. He is looking for the highest high, not the bar index of the highest high. Obviously you need to do something different to get the bar index of the highest high.


 
 Post subject: Re: How to determine highest high and lowest low Post rating: 0   Post Posted: Wed 14 Jul, 2010, 08:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
As DarkMan said
Quote:
For example I know this value from GBPUSD from 00:00 to 7:30 CET
he want to determine exact start time and end time of period, so it means that start point and end point could be any date value.
When you are using an indicator, you specify the Period that actually determines, which candle are used to calculate the min/max. Parameter timePeriod in indicators determines the count of candles that is used to calculate its value. (here interesting stuff https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=5&t=2345). It means that, when you are using indicators to calculate some value, you are closely related to candles, that are used to calculate it. Even if you are using indicator, where you can specify time (https://www.dukascopy.com/swiss/docs/api/com/dukascopy/api/IIndicators.html#max(com.dukascopy.api.Instrument,%20com.dukascopy.api.Period,%20com.dukascopy.api.OfferSide,%20com.dukascopy.api.IIndicators.AppliedPrice,%20int,%20com.dukascopy.api.Filter,%20int,%20long,%20int)), you must specify this time correctly - finding exact candles start time from IHistory.getBarsStart();
Off course, there is one more approach, you can use an indicator with a smallest standard Period (Period.TICK - this is like one second period) and then just calculate how many candles are in your preferred time period.


 

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