Dukascopy
 
 
Wiki JStore Search Login

Slow EMA calculation
 Post subject: Slow EMA calculation Post rating: 0   New post Posted: Tue 11 Jun, 2013, 12:49 
User avatar

User rating: 1
Joined: Thu 15 Mar, 2012, 16:30
Posts: 20
Hello,
In my Exampla Strategy I'am calculating the latest EMA-Value for every Tick and measure the Execution-Time for EMA-Calculation.
When I run that Strategy in HistoricalTester it runs fast (EMA-Calc. takes about ~0.03 ms)
When running the same Strategy in realtime-Mode it slows down radically (EMA-Calc. now takes about 2000 ms up to 9000 ms)
What could be the Reason for this and how do i fix it?


Attachments:
RangeBarTest.java [6.1 KiB]
Downloaded 455 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Slow EMA calculation Post rating: 0   New post Posted: Wed 12 Jun, 2013, 12:18 
User avatar

User rating: 1
Joined: Thu 15 Mar, 2012, 16:30
Posts: 20
Thank's for having a Look on it.
I noticed that LinearWightedMA has the same Bug.


 
 Post subject: Re: Slow EMA calculation Post rating: 0   New post Posted: Fri 14 Jun, 2013, 12:12 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Just shooting in the dark:
Do you have the same delay if you use
indicators.ema(Instrument, Period, OfferSide, IIndicators.AppliedPrice, int, int)

instead of
indicators.calculateIndicator()
?

Of course your code is valid also, just I don`t use calculateIndicator().


 
 Post subject: Re: Slow EMA calculation Post rating: 0   New post Posted: Fri 14 Jun, 2013, 12:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can use the former method only when working with candle-stick or tick feeds, for other feeds you need to use the universal calculation method.


 

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