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.

Bollinger Bands
 Post subject: Bollinger Bands Post rating: 0   New post Posted: Fri 27 Apr, 2012, 13:05 

User rating: 0
Joined: Fri 02 Mar, 2012, 14:06
Posts: 3
Hi,

I have a piece of code that calculates 5-minute BBands in onTick():

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {
        ...
        double[] indBB = indicators.bbands(instrument, Period.FIVE_MINS, OfferSide.BID, AppliedPrice.CLOSE, 800, 2, 2, IIndicators.MaType.EMA, 0);
        ...
    }


However, as I'm printing out the BBands levels, these values are drastically different from the JForex chart with BBands (800,2,2,EMA) drawn on the 5 minute chart. It's almost like I'm looking at entirely different indicators. Any hints on why this is?

Thanks


 
 Post subject: Re: Bollinger Bands Post rating: 0   New post Posted: Fri 27 Apr, 2012, 14:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please go through the following checklist:
https://www.dukascopy.com/wiki/#Indicato ... _checklist
Note that the indicator calculation by shift implicitly uses Filter.NO_FILTER.


 

Jump to:  

  © 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