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.

SMA over RSI custom indicator
 Post subject: SMA over RSI custom indicator Post rating: 0   New post Posted: Fri 23 Apr, 2010, 17:46 

User rating: 0
Joined: Tue 18 Aug, 2009, 15:09
Posts: 10
Hi,

I guess I'm still struggling with this one.
Can you explain for example, if you add to a chart rsi(14), then in the same panel right click to add SMA over RSI (14, 14) over it, the two rsi lines aren't the same ??? Is this a bug in the graphical representation or an issue with the custom indicator ?

thanks


 
 Post subject: Re: SMA over RSI custom indicator Post rating: 0   New post Posted: Tue 27 Apr, 2010, 08:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
it's because scales are different. The RSI indicator have scale from 0 till 100, but for a SMAoverRSI is not defined scale. To define a scale, you need to implement IMinMax. Please consider the following code snippet:
    .  .  .
public class SMAOverRSIIndicator implements IIndicator, [b]IMinMax[/b] {
    .  .  .
       @Override
   public double[] getMinMax(int outputIdx, Object values,
         int firstVisibleValueIndex, int lastVisibleValueIndex) {
        return new double[] {0, 100};
   }


 

Jump to:  

  © 1998-2026 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