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.

Multiple Element Indicator for Renko BArs
 Post subject: Multiple Element Indicator for Renko BArs Post rating: 0   New post Posted: Tue 29 Oct, 2013, 01:59 

User rating: 0
Joined: Mon 17 Jun, 2013, 23:30
Posts: 48
Location: Australia, Melbourne
Hi,

I took the Feeds.java example and I extended it with additional indicators. However even though the program compiles OK, it gives an error when it is run, regarding the indicators that have multiple elements (STOCHASTIC, MACDEXT):
"Error in indicator:java.lan.ClassCastException:com.dukascopy.api.IIndicators$MAType cannot be cast to java.lang.Integer @ com.dukascopy.indicators.StochasticIndicator.setOptInputParameter(StochasticIndicator.java:162)"

Can somebody suggest how to define a multi-element indicator for RENKO or point out what is wrong and how should be done in my code (attached)
Also, it appears that the Renko bar can only accept certain sizes (2,5,pips). IS there such a limitation, can define the Renko bar for whatever size or what are the restricted sizes?

Regards


Attachments:
FeedsEU01.java [16.84 KiB]
Downloaded 144 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Multiple Element Indicator for Renko BArs Post rating: 0   New post Posted: Tue 29 Oct, 2013, 08:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Use slowMaType.ordinal instead of slowMaType. This applies also to other MaType usage cases.


 
 Post subject: Re: Multiple Instrument for Renko Bars Post rating: 0   New post Posted: Thu 31 Oct, 2013, 23:23 

User rating: 0
Joined: Mon 17 Jun, 2013, 23:30
Posts: 48
Location: Australia, Melbourne
Dear Support,

Thank you very much for the previous answer, it solved the problem.

I found "ReadTicksForRenkoToFile.java" and it does seem to address many of my requirements. However, when I try to compile I get:"The type MockRenko must implement the inherited abstract method IRenkoBar.getWickPrice()"


Is there a problem in the code?

Thank you very much in advance

Kind Regards


 
 Post subject: Re: Multiple Element Indicator for Renko BArs Post rating: 2   New post Posted: Fri 01 Nov, 2013, 14:36 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Probably the example that you have found in wiki were not update to the latest API.
If you use and IDE (like NetBeans or Eclipse), you can use them to solve these problems easily...

You have to do what the error says. Add this at the end:
    @Override
    public IRenkoBar getInProgressBar() {
        // TODO Auto-generated method stub
        return null;
    }

    // This is the new code!
    @Override
    public double getWickPrice() {

        return 0;
    }


and probably this will solve the compile error. But if you need to really implement the getWickPrice() method, then wait for Support to help out.


 
The Best Answer  Post subject: Re: Multiple Element Indicator for Renko BArs Post rating: 0   New post Posted: Fri 01 Nov, 2013, 15:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The example has been updated according to the new IRenkoBar implementation version.


 
 Post subject: Re: Multiple Element Indicator for Renko BArs Post rating: 0   New post Posted: Sat 02 Nov, 2013, 02:08 

User rating: 0
Joined: Mon 17 Jun, 2013, 23:30
Posts: 48
Location: Australia, Melbourne
Thank you Tamas,

Thank you Support.

Much appreciated


 

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