Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2016.04.26 16:32
The optimized variant of the Kaufman's Adaptative Moving Average by wellx

The optimized variant of the Kaufman's Adaptative Moving Average by wellx - indicator for MetaTrader 4

| English Español Português 日本語 Deutsch Русский 中文

Views:
3232
Rating:
votes: 7

The optimized variant of the AMA indicator by wellx. The original had undergone optimization in December 2006 to allow it to be usable in Expert advisors. The unoptimized version consumed resources and allowed to perform/optimization of an EA containing calls to the AMA in a reasonable time.

Its appearance is the same as the original.

The optimized variant of the Kaufman's Adaptative Moving Average


It is possible to "feel the difference" in the testing speed using a simple expert.

//+------------------------------------------------------------------+
//|                                                      TestAMA.mq4 |
//|                                                             Rosh |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Rosh"
#property link      "http://www.metaquotes.net"
 
 
extern int AMAtype=1;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   if (AMAtype!=0) Print("Use the optimized indicator");
   else Print("Use the original version of the indicator");
   Print("Start");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Print("Finish");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   double val;
   if (AMAtype!=0) val=iCustom(Symbol(),0,"AMA for Expert2",0,1);
   else val=iCustom(Symbol(),0,"AMA",0,1);
//----
   return(0);
  }
//+------------------------------------------------------------------+

If the external variable AMAtype=0, then use the original, if not zero, use this indicator.


Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/7379

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

Modify All TP SL Modify All TP SL

The script modifies all orders (market and pending) on the symbol with specified Take Profit and Stop Loss.

iFractals 4all TF iFractals 4all TF

Buy or sell just by looking at the "arrow" as a signal. Very easy and simple.