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
Stocks - Wall Street Gains on Trade Optimism; Boeing Drags on Dow  
21.10.2019 14:24
Investing.com – Wall Street opened higher on Monday, as upbeat rhetoric around trade continued to support sentiment in the absence of much hard news. White House adviser Larry Kudlow told Fox Business that tariffs scheduled for December could be withdrawn if trade negotiations go well. His comments follow positive trade chatter over the
Read more
Shun Malaysia, India's palm oil buyers told amid Kashmir standoff
21.10.2019 14:21
By Rajendra Jadhav and Aftab Ahmed NEW DELHI (Reuters) - India's top vegetable oil trade body on Monday asked its members to stop buying palm oil from Malaysia, an unprecedented call that could help New Delhi punish the Southeast Asian country for criticizing India over its policy towards Kashmir. The directive by the Solvent Extractors’
Read more
Drug companies reach settlement, averting first federal opioid trial
21.10.2019 14:18
By Kathy Gray CLEVELAND (Reuters) - Four large drug companies reached a last-minute $260 million legal settlement over their role in the U.S. opioid addiction epidemic, averting the first federal trial that was scheduled to start Monday morning in Cleveland. The settlement covers drug distributors AmerisourceBergen Corp (N:ABC), Cardinal Health
Read more
Italy's biggest bank wants to become less Italian
21.10.2019 14:15
By Silvia Aloisi and Gianluca Semeraro MILAN (Reuters) - The chief executive of UniCredit (MI:CRDI) has a plan to revive his company's ailing share price - make it less Italian. Italy's biggest bank is looking at whether it can distance itself from its home country's stagnating economy and fractious politics by putting some of its
Read more
U.S. effective fed funds rate unchanged, below Fed's target range
21.10.2019 14:12
NEW YORK (Reuters) - The average interest rate banks charge each other to borrow reserves overnight was steady on Friday, below the Federal Reserve's target range, as the U.S. central bank injected billions of cash into the banking system to prevent a liquidity crunch. The average or effective interest rate in the federal funds market was
Read more