Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

drawing indicator twice on one chart problem
 Post subject: drawing indicator twice on one chart problem Post rating: 0   New post Posted: Mon 25 Feb, 2019, 12:19 

User rating: 0
Joined: Tue 11 Oct, 2016, 16:41
Posts: 4
I've tried add to one chart two the same indicators drawing object (examples from https://www.dukascopy.com/wiki/en/development/indicator-api/examples/indicator-draws-chart-objects) on chart with diferent optional inpus. Unfortunatelly only one has been drawn correctly (with period 20), the second one (period 10) is not visible.
Image

There is something what sholud bee added to code to fix it?

Thank you so much in advance,
Lukas


 
 Post subject: Re: drawing indicator twice on one chart problem Post rating: 0   New post Posted: Wed 08 May, 2019, 09:35 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1045
Location: Geneva, Switzerland
Please provide the code sample.


 
 Post subject: Re: drawing indicator twice on one chart problem Post rating: 0   New post Posted: Sat 15 Feb, 2020, 16:21 

User rating: 0
Joined: Thu 09 Jan, 2020, 13:19
Posts: 2
Location: BrazilBrazil
I have a similar, if not the same problem. My indicator does not draw on the chart, but I call it twice from the strategy using different optional inputs. As you can see from the code sample below, I have different IIndicator objects (track2s and track2b) for a custom indicator Track2. Track2 accepts 1 optional input. In code below either 3.5 or 6.5. Despite all this, when I display the first output index from strategy, the values are the same! BUT, if I print from inside the custom indicator, each indicator value is different (correct) because OptionalInputs are different.

This problem is sooooo annoying!

           Object[] rngResult = indicators.calculateIndicator(
                this.rangeDescriptor,
                new OfferSide[] { OfferSide.BID },
                track2s.getIndicatorInfo().getName(),
                new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
                new Object[]{ 3.5 },
                0
            );
            loadArrays( rngResult, 0);
           
            Object[] rngResult2 = indicators.calculateIndicator(
                this.rangeDescriptor,
                new OfferSide[] { OfferSide.BID },
                track2b.getIndicatorInfo().getName(),
                new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
                new Object[]{ 6.5 },
                0
            );
            loadArrays( rngResult2, 1);


 
 Post subject: Re: drawing indicator twice on one chart problem Post rating: 0   New post Posted: Wed 19 Feb, 2020, 11:18 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Hello.

To reproduce the issue please send source code of custom indicator and strategy to [email protected].

Kind regards, Support Team.


 

Jump to:  

cron
  © 1998-2024 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