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 to apply an indicator to another indicator?
 Post subject: How to apply an indicator to another indicator? Post rating: 0   New post Posted: Sun 01 Apr, 2018, 09:50 

User rating: 0
Joined: Sun 01 Apr, 2018, 09:35
Posts: 1
Location: SwitzerlandSwitzerland
I kinda spent some time reading the documentation but i still can't understand how to apply an indicator like sma to stDev.

double dev[] = indicators.stdDev(instrument, period, myOfferSide, IIndicators.AppliedPrice.CLOSE, stDevPeriod, nbDev, Filter.WEEKENDS, candlesBefore, currBarTime, candlesAfter);
// and here we call the sma.... But how
double ma[] = ?????


is it
indicators.calculate()
or can i do
indicators.ma(.....);


???


 
 Post subject: Re: How to apply an indicator to another indicator? Post rating: 0   New post Posted: Tue 17 Apr, 2018, 15:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can do it in both ways, here is more information about indicator calculation in your strategy: https://www.dukascopy.com/wiki/en/development/strategy-api/indicators/indicator-calculation

SMA named method:
        double smaNaming = indicators.sma(
                Instrument.EURUSD,
                Period.TEN_MINS,
                OfferSide.BID,
                IIndicators.AppliedPrice.CLOSE,
                14,
                0
        );


SMA with universal calculation method:
        Object[] smaUniversal = indicators.calculateIndicator(
                Instrument.EURUSD,
                Period.TEN_MINS,
                new OfferSide[] {OfferSide.BID},
                null,
                "SMA",
                new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
                new Object[] {14},
                0
        );


 

Jump to:  

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