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.

How do I call the Heikin Ashi indicator ?
 Post subject: How do I call the Heikin Ashi indicator ? Post rating: 0   New post Posted: Mon 01 Sep, 2014, 14:52 
User avatar

User rating: 0
Joined: Sun 22 Sep, 2013, 22:29
Posts: 18
Location: RomaniaRomania
I don't quite understand how to call it, nor do I know the difference between HeikinAshi and HeikinAshiSingle. I would like to find out the values for the previous daily bar. I'm a MetaTrader programmer and know how to call indicators in both MQL4/MQL5. Could I have a sample code for this ?


 
 Post subject: Re: How do I call the Heikin Ashi indicator ? Post rating: 1   New post Posted: Tue 02 Sep, 2014, 11:48 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

Something like this:
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    double[][] hAshi = indicators.heikinAshi(instrument, Period.DAILY, OfferSide.BID, Filter.NO_FILTER, 1, bidBar.getTime(), 0);
}


The array will contain 4 values:
hAshi[0][0]: Open
hAshi[0][1]: Close
hAshi[0][2]: High
hAshi[0][3]: Low


The difference between heikinAshi and heikinAshiSingle is that the latter returning an IBar, instead of a double array with the OHLC data of a particular bar.


 

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