MetaTrader 5用のAltarius RSIストキャスティクスEAの紹介

Mike 2017.03.02 18:51 39 0 0
添付ファイル

今回ご紹介するのは、MetaTrader 5用のEA「Altarius RSIストキャスティクス」です。このEAは、2つのストキャスティクスオシレーター(iStochastic)と1つのRSI(相対力指数、iRSI)を使用しています。

アイデアの著者cxaMQL5コードの著者barabashkakvn

このEAでは、過去の取引分析に基づいてロットサイズを計算します。以下にその計算ロジックを示します:

//+------------------------------------------------------------------+
//| 最適ロットサイズの計算                                          |
//+------------------------------------------------------------------+
double LotsOptimized()
  {
   double lot=Lots;
   int    losses=0;                  // 休止なしの損失取引数
//--- ロットサイズ選択
   lot=NormalizeDouble(m_account.FreeMargin()*MaximumRisk/1000.0,2);
//--- 休止なしの損失取引数を計算
   if(DecreaseFactor>0)
     {
      //--- 取引履歴の取得
      HistorySelect(TimeCurrent()-86400,TimeCurrent()+86400);
      //---
      uint     total=HistoryDealsTotal();
      //--- すべての取引について
      for(uint i=0;i<total;i++)
        {
         if(!m_deal.SelectByIndex(i))
           {
            Print("履歴にエラーがあります!");
            break;
           }
         if(m_deal.Symbol()!=Symbol() || m_deal.Entry()!=DEAL_ENTRY_OUT)
            continue;
         //---
         if(m_deal.Profit()>0)
            break;
         if(m_deal.Profit()<0)
            losses++;
        }
      if(losses>1)
         lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
     }
//--- ロットサイズを返す
   if(lot<0.1)
      lot=0.1;
   return(lot);
  }

バックテストの結果(EURUSDとUSDJPY)はこちらです:

Altarius RSI Stohastic USDJPY, H1 

Altarius RSI Stohastic EURUSD,H1 

Altarius RSI Stohastic USDJPY,M15 

Altarius RSI Stohastic EURUSD,M15 

リスト
コメント 0