Kaufmanの適応移動平均の最適化版 - MetaTrader 4用インジケーター

Mike 2016.04.27 01:32 40 0 0
添付ファイル

wellxによるAMAインジケーターの最適化版です。元のバージョンは、Expert Advisorで使用できるように2006年12月に最適化されました。最適化されていないバージョンはリソースを消費し、AMAを呼び出すEAのパフォーマンスと最適化を合理的な時間内に行うことができませんでした。

Kaufmanの適応移動平均の最適化版


シンプルなエキスパートを使用することで、テスト速度の「違い」を実感できます。

//+------------------------------------------------------------------+//|                                                            TestAMA.mq4 |//|                                                             Rosh |//|                                                            http://www.metaquotes.net |//+------------------------------------------------------------------+#property copyright"Rosh"#property link      "http://www.metaquotes.net"externint AMAtype=1;
//+------------------------------------------------------------------+//| expert initialization function                                   |//+------------------------------------------------------------------+int init()
  {
//----
   if (AMAtype!=0) Print("最適化されたインジケーターを使用しています");
   elsePrint("元のインジケーターを使用しています");
   Print("開始します");
//----
   return(0);
  }
//+------------------------------------------------------------------+//| expert deinitialization function                                 |//+------------------------------------------------------------------+int deinit()
  {
//----
   Print("終了します");
//----
   return(0);
  }
//+------------------------------------------------------------------+//| expert start function                                            |//+------------------------------------------------------------------+int start()
  {
//----
   double val;
   if (AMAtype!=0) val=iCustom(Symbol(),0,"Expert2用AMA",0,1);
   else val=iCustom(Symbol(),0,"AMA",0,1);
//----
   return(0);
  }
//+------------------------------------------------------------------+

外部変数AMAtypeが0の場合は元のインジケーターを使用し、0以外の場合はこのインジケーターを使用します。


リスト
コメント 0