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.

geting an error when trying to import com.dukascopy.api.feed
 Post subject: geting an error when trying to import com.dukascopy.api.feed Post rating: 0   Post Posted: Thu 18 Aug, 2011, 22:29 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
Hello,

I need to get some calculations in a strategy, based on the Point&Figure charts. For that I found some informations at this link: https://www.dukascopy.com/wiki/index.php ... and_Figure

My problem is that in order to implement that code, I need to import the com.dukascopy.api.feed package and it seems that I can not do that. Bellow is the print screen with the error that I am geting.

Attachment:
Capture.JPG [120.79 KiB]
Downloaded 400 times


Thank you very much in advance!


 
 Post subject: Re: geting an error when trying to import com.dukascopy.api. Post rating: 0   Post Posted: Fri 19 Aug, 2011, 07:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please be advised that JForex client uses JForex-API-2.6.38, but current standalone uses a newer version - JForex-API-2.6.43.
For JForex-API-2.6.43 you use:
import com.dukascopy.api.feed.IPointAndFigure;
import com.dukascopy.api.feed.IPointAndFigureFeedListener;
For JForex-API-2.6.38 you use:
import com.dukascopy.api.bar.IPointAndFigure;
import com.dukascopy.api.listener.IPointAndFigureFeedListener;
This inconvenience will be resolved with the next release of the JForex client


 
 Post subject: Re: geting an error when trying to import com.dukascopy.api. Post rating: 0   Post Posted: Fri 19 Aug, 2011, 10:40 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
Thank you very much for your prompt answer! It solves part of my problem, but I still have one, described bellow.

I try to implement the following code:

public class LIVE11_point_and_figure_EURUSD implements IStrategy {
   ...   
   private IHistory history;
   ...
   public void onStart(IContext context) throws JFException {
      ...       
      history = context.getHistory();
      ...
   }
   ....
   public void onTick(Instrument instrument, ITick tick) throws JFException {
       ...       
      IPointAndFigure prevBar1 = history.getPointAndFigure(selectedInstrument, OfferSide.BID, PriceRange.valueOf(1), ReversalAmount.valueOf(1), 1);
       IPointAndFigure prevBar2 = history.getPointAndFigure(selectedInstrument, OfferSide.BID, PriceRange.valueOf(1), ReversalAmount.valueOf(1), 2);
       ....
    }
    ....
}


When compiling I am getting the error "09:27:27 The method getPointAndFigure(Instrument, OfferSide, PriceRange, ReversalAmount, int) is undefined for the type IHistory".

But when I check the documentation, at this link: https://www.dukascopy.com/client/javadoc// , I find that get.PointAndFigure method is included in the IHistory interface.

Can you please tell me what package of interface do I need to import in order for the above code to work and to be able to call the get.PointAndFigure method ?


Thanks again!


 
 Post subject: Re: geting an error when trying to import com.dukascopy.api. Post rating: 0   Post Posted: Fri 19 Aug, 2011, 13:05 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
I found a work around this problem, using the feedlistener method but still, is just a temporary fix.

If the problem described above could be fixed, it would be a much nicer and cleaner solution :)


Thanks in advance!


 
 Post subject: Re: geting an error when trying to import com.dukascopy.api. Post rating: 0   Post Posted: Fri 19 Aug, 2011, 13:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
iulian wrote:
When compiling I am getting the error "09:27:27 The method getPointAndFigure(Instrument, OfferSide, PriceRange, ReversalAmount, int) is undefined for the type IHistory".

But when I check the documentation, at this link: https://www.dukascopy.com/client/javadoc// , I find that get.PointAndFigure method is included in the IHistory interface.
The reason for this is about the same - the IHistory.getPointAndFigure method is available starting with JForex-API version 2.6.43.


 

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