|
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.
My OfferSide Mod |
Pirate
|
Post subject: My OfferSide Mod |
Post rating: 0
|
Posted: Mon 08 Aug, 2011, 17:57
|
|
User rating: 0
Joined: Sat 06 Aug, 2011, 23:17 Posts: 27 Location: Russian Federation,
|
Hi all, need help^ ... OfferSide priceTypical = price_typical(); iCCI_Signal = indicators.cci(instrument, Period.FIFTEEN_MINS, priceTypical, period, 1); ...
//+--------------------------------------------------------------------------------------------------------------+ //| price_typical. Аналог PRICE_TYPICAL для индикатора CCI. //+--------------------------------------------------------------------------------------------------------------+ public OfferSide price_typical () throws JFException { //+--------------------------------------------------------------------------------------------------------------+ OfferSide newprice = (high(1, OfferSide.BID, Period.FIFTEEN_MINS)+low(1, OfferSide.BID, Period.FIFTEEN_MINS)+close(1, OfferSide.BID, Period.FIFTEEN_MINS))/3; return newprice; }
... Staff...
//+--------------------------------------------------------------------------------------------------------------+ //| low. Массив-таймсерия, содержащий минимальные цены каждого бара текущего графика. //+--------------------------------------------------------------------------------------------------------------+ public double low(int index, OfferSide side, Period period) throws JFException{ //+--------------------------------------------------------------------------------------------------------------+ return history.getBar(instrument, period, side, index).getLow(); }
//+--------------------------------------------------------------------------------------------------------------+ //| high. Массив-таймсерия, содержащий максимальные цены каждого бара текущего графика. //+--------------------------------------------------------------------------------------------------------------+ public double high(int index, OfferSide side, Period period) throws JFException{ //+--------------------------------------------------------------------------------------------------------------+ return history.getBar(instrument, period, side, index).getHigh(); }
//+--------------------------------------------------------------------------------------------------------------+ //| close. Массив-таймсерия, содержащий цены закрытия каждого бара текущего графика. //+--------------------------------------------------------------------------------------------------------------+ public double close(int index, OfferSide side, Period period) throws JFException{ //+--------------------------------------------------------------------------------------------------------------+ return history.getBar(instrument, period, side, index).getClose(); }
If a try docompile EA, Jforex send message - Type mismatch: cannot convert from double to OfferSideHow are fixed this problem? Thanks for help!
|
|
|
|
 |
API Support
|
Post subject: Re: My OfferSide Mod |
Post rating: 0
|
Posted: Tue 09 Aug, 2011, 07:38
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
Pirate
|
Post subject: Re: My OfferSide Mod |
Post rating: 0
|
Posted: Tue 09 Aug, 2011, 11:02
|
|
User rating: 0
Joined: Sat 06 Aug, 2011, 23:17 Posts: 27 Location: Russian Federation,
|
I now there error in my code.
How convert double to OfferSide, or why realize price_typical function?
|
|
|
|
 |
API Support
|
Post subject: Re: My OfferSide Mod |
Post rating: 0
|
Posted: Tue 09 Aug, 2011, 11:22
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
You don't need to calculate the typical price, the indicator does it for you. That is just make the indicator call in the following way: iCCI_Signal = indicators.cci(instrument, Period.FIFTEEN_MINS, IIndicators.AppliedPrice.TYPICAL_PRICE, period, 1);
|
|
|
|
 |
Pirate
|
Post subject: Re: My OfferSide Mod |
Post rating: 0
|
Posted: Tue 09 Aug, 2011, 17:17
|
|
User rating: 0
Joined: Sat 06 Aug, 2011, 23:17 Posts: 27 Location: Russian Federation,
|
In https://www.dukascopy.com/client/javadoc ... ,%20int%29 It is impossible to use AppliedPrice.* for CCI double cci(Instrument instrument, Period period, OfferSide side, int timePeriod, int shift) AppliedPrice.* use for indicator ma - https://www.dukascopy.com/client/javadoc ... ,%20int%29 , not for CCIIf i try decompile iCCI_Signal = indicators.cci(instrument, Period.FIFTEEN_MINS, IIndicators.AppliedPrice.TYPICAL_PRICE, period, 1); send message16:11:38 The method cci(Instrument, Period, OfferSide, int, int) in the type IIndicators is not applicable for the arguments (Instrument, Period, IIndicators.AppliedPrice, int, int)
|
|
|
|
 |
API Support
|
Post subject: Re: My OfferSide Mod |
Post rating: 0
|
Posted: Wed 10 Aug, 2011, 07:22
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Pardon, the right function call is: iCCI_Signal = indicators.cci(instrument, Period.FIFTEEN_MINS, OfferSide.BID, period, 1); We reiterate that the typical price calculation gets carried out in the indicator itself so you don't need to pass this value to it.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|