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.

QUESTION: Strategy Indicator Code Efficiency
 Post subject: QUESTION: Strategy Indicator Code Efficiency Post rating: 0   New post Posted: Wed 22 Apr, 2020, 01:22 
User avatar

User rating: 1
Joined: Fri 14 Sep, 2012, 02:25
Posts: 55
Location: New Zealand, Christchurch
hi team - I'm a relative newbie, so please forgive the school-boy question ...
but is there really an efficiency (i.e. execution speed) difference between these two methods of getting a simple Indicator value in my onTick code:

1. Object[] indicatorResult = indicators.calculateIndicator(selectedInstrument, selectedPeriod, new OfferSide[] {OfferSide.BID},
selectedMaTypeString, new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {MABars5}, 0);
double MA5 = (Double) indicatorResult[0];


2. double MA5 = indicators.ma(selectedInstrument, selectedPeriod, offerSide, appliedPrice, MABars5, selectedMaType, 0);

I prefer the simplicity of the second method, but in backtesting it seems to run a LOT slower ...


 
 Post subject: Re: QUESTION: Strategy Indicator Code Efficiency Post rating: 0   New post Posted: Tue 26 May, 2020, 17:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello.

Named methods for indicator calculation like
https://www.dukascopy.com/client/javado ... aType-int-
just call universal calculation methods like
https://www.dukascopy.com/client/javado ... ilter-int-
so there must be no significant difference in performance

Kind regards.


 

Jump to:  

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