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.

ht_trendline with indicators.calculateIndicators
 Post subject: ht_trendline with indicators.calculateIndicators Post rating: 0   New post Posted: Tue 14 Sep, 2010, 16:11 

User rating: 0
Joined: Tue 10 Nov, 2009, 16:58
Posts: 65
I have the following code :
        if(period == Period.ONE_HOUR){
            mInputParamsHttrendline = new Object[]{0};
            mOfferSideBID = new OfferSide[]{OfferSide.BID};
            m_ht_trendline_1_hour = indicators.calculateIndicator(instrument,
                                                                Period.ONE_HOUR,
                                                                mOfferSideBID,
                                                                "HT_TRENDLINE",
                                                                null,
                                                                mInputParamsHttrendline,
                                                                Filter.ALL_FLATS,
                                                                2,
                                                                askBar.getTime(),
                                                                0);



it always gives me a null pointer exception.
I tried initializing
mInputParamsHttrendline = new Object[]{0};
or using null as that parameter, since HT_TRENDLINE does not have any parameter that I can tell.

How can I use this indicator with this calculateIndictors method ?


 
 Post subject: Re: ht_trendline with indicators.calculateIndicators Post rating: 0   New post Posted: Wed 15 Sep, 2010, 11:51 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
You forgot to specify the AppliedPrice parameter:
if(period == Period.ONE_HOUR){
            mInputParamsHttrendline = new Object[]{};
            mOfferSideBID = new OfferSide[]{OfferSide.BID};
            m_ht_trendline_1_hour = indicators.calculateIndicator(instrument,
                                                                Period.ONE_HOUR,
                                                                mOfferSideBID,
                                                                "HT_TRENDLINE",
                                                                new AppliedPrice[]{AppliedPrice.CLOSE},
                                                                mInputParamsHttrendline,
                                                                Filter.ALL_FLATS,
                                                                2,
                                                                askBar.getTime(),
                                                                0);


 

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