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.

Price Channel indicator question/problem/use.
 Post subject: Price Channel indicator question/problem/use. Post rating: 0   New post Posted: Fri 26 Nov, 2010, 09:26 

User rating: 0
Joined: Thu 19 Aug, 2010, 13:53
Posts: 62
Hi,

If I plot PCHANNEL - price channel indicator on the chart, then I get lines which I suppose there are the Highs & Lows over the period specified, Blue and Green Lines named Up/Low.

Now, I want call indicator from strategy code. I suppose the below the method to call, but I dont understand it.
If indicator plots Highs and Lows over period, why the method asks for MaType, fast and slow period and Applied price ?
Can you explain how I get called it called ? What it returns. I know about MINMAX indicator and the others but I want this. I looked in Indicators sections in PriceChannelIndicator source code and it internally uses MINMAX but I dont see why the method below needs fast/slow period and the others arguments. It would only need Period,OfferSide, timePeriod and shift. Is this the correct method to call ? Thank you.

double[] prchannel(Instrument instrument,
Period period,
OfferSide side,
IIndicators.AppliedPrice appliedPrice,
int fastPeriod,
int slowPeriod,
IIndicators.MaType maType,
Filter filter,
int numberOfCandlesBefore,
long time,
int numberOfCandlesAfter)
throws JFException

Also, what is the difference between MIDPOINT and MIDPRICE indicators ?. If I plot them wih same price/period they have identical lines.


 
 Post subject: Re: Price Channel indicator question/problem/use. Post rating: 0   New post Posted: Wed 01 Dec, 2010, 11:34 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
The method you mentioned does indeed require some redundant parameters, this will be fixed for the next release, meanwhile you can use the universal IIndicators.calculateIndicator method to call the Price Channel Indicator, i.e.
Object[] pchannel = indicators.calculateIndicator(Instrument.EURUSD, Period.ONE_HOUR, new OfferSide[] {OfferSide.ASK}, "PCHANNEL",  
             new AppliedPrice[] {}, new Object[]{5}, shift);

Also, have a look at the following JForex Wiki article for more details: https://www.dukascopy.com/wiki/index.php ... Indicators
The first output is max High and the second is min Low.

MIDPOINT indicator lets you select a price type for calculations (i.e. Close price or Open price), MIDPRICE uses bar high and bar low in its calculations.


 

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