Exponential moving average - indicator for MetaTrader 5




Exponential moving average - indicator for MetaTrader 5


In the "back to basic" again :

Even though EMA is fairly simple and the code execution time should not vary a lot from one version to another (EMA does not have loops within the loops), it seems that we are still lacking some easy to reuse code that is fast in execution also. This version fills that a bit

PS: using the alternative mode of OnCalculate() - this mode :

int  OnCalculate( 
   const int        rates_total,       // price[] array size 
   const int        prev_calculated,   // number of handled bars at the previous call 
   const int        begin,             // index number in the price[] array meaningful data starts from 
   const double&    price[]            // array of values for calculation 
   );

would make the execution time even shorter and faster (getting the chose price through a function does take it share of time - not too much but compared to a version that does not have to do that, it can be noticed) but, for the sake of flexibility, using the "standard" mode. Also making it a single color version would make it even faster, but then what would be the fun :)




Download Exponential moving average - indicator for MetaTrader 5




Related News




Latest News
Porsche invests in Israeli road visibility startup TriEye
21.08.2019 09:06
TEL AVIV (Reuters) - Israel's TriEye, whose short-wave-infra-red sensing technology enables vision in adverse weather and night-time conditions, has expanded its funding round to $19 million with an investment from German sports car manufacturer Porsche (DE:PSHG_p). The amount invested by Porsche was not disclosed. TriEye said on Wednesday
Read more
Exclusive: China's Tianjin government orders Bohai Steel restructuring start by September: sources
21.08.2019 09:03
By Shu Zhang and Muyu Xu SINGAPORE/BEIJING (Reuters) - The government of the Chinese city of Tianjin, the only shareholder of bankrupt Bohai Steel Group Ltd, is demanding that Bohai's creditors and strategic investor implement a bankruptcy restructuring plan by the end of September, two creditor sources with direct knowledge of the matter
Read more
Fiat-Renault deal hopes lift European shares
21.08.2019 08:24
(Reuters) - European shares rebounded from the previous session's sharp falls on Wednesday, with brokers pointing to an Italian report on continuing merger talks between Fiat Chrysler Automobiles (MI:FCHA) and Renault SA (PA:RENA) as pushing car industry shares higher. The pan-European STOXX 600 index (STOXX) rose 0.5% at 0716 GMT, with
Read more
Forex - Dollar Hovering Near 3-Week Highs ahead of Fed Minutes
21.08.2019 08:21
Investing.com - The U.S. dollar was hovering just below three-week highs in subdued trade on Wednesday as investors looked ahead to the minutes of the Federal Reserve’s July meeting later in the day for fresh clues on the monetary policy outlook. The Fed cut rates for the first time since 2008 last month in what Chairman Jerome Powell called
Read more
China says natural for China, U.S. to have differences on trade
21.08.2019 08:18
BEIJING (Reuters) - China's Foreign Ministry said on Wednesday it was natural for the United States and China to have differences on trade, but the key was to resolve issues through dialogue. Ministry spokesman Geng Shuang made the comments at a daily news briefing in Beijing.
Read more