Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Wellx Optimized Variant of Kaufman Adaptive Moving Average - MetaTrader 4 Script - MT4/MT5 Resource

author EAcpu | 5 reads | 0 comments |

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

Optimized variant of Wellx's AMA indicator . The original version was optimized for use in Expert Advisor in December 2006. The unoptimized version consumes resources and allows execution/optimization of EAs containing calls to AMA in a reasonable time.

Its appearance is the same as the original.

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

Optimized variant of Kaufman adaptive moving average


Use Simple Expert to "feel the difference" in test speed.

 //+------------------------------------------------------------------+
//| TestAMA.mq4 |
//| Roche|
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "rosh"
#Property associated with "http://www.metaquotes.net"

External integer AMA type = 1 ; //+---------------------------------------------------------------------------------+
//|Expert initialization function |
//+------------------------------------------------------------------+
integer_initialize ()
  { //---- if (AMA type! = 0 ) print ( "Use optimization indicators" );
elseprint ( "Use original version of indicator" ) ;
print ( "start" ); //---- return ( 0 );
  } //+------------------------------------------------------------------+
//|Expert to initialize function |
//+------------------------------------------------------------------+
integer deinitialization()
  { //---- Print ( "End" ); //---- Return ( 0 );
  } //+------------------------------------------------------------------+
//|Expert start function |
//+------------------------------------------------------------------+
integer start()
  { //---- Double value;
if (AMA type != 0 ) value = custom ( symbol (), 0 , "AMA by Expert 2" , 0 , 1 );
Other values ​​= custom ( symbol (), 0 , "Ama" , 0 , 1 ); //---- Return ( 0 );
  } //+------------------------------------------------------------------+

If the external variable AMAtype=0, the original one is used, if it is not zero, the indicator is used.


Attachment download

📎AMA_for_Expert2.mq4 (5.31 KB)

Source: MQL5 #7379

Verification code Refresh