Download MetaTrader 5
To add comments, please log in or register
All activity at MQL5.community is clearly visible. Have a look at the Wall!
AYMERIC75
112
AYMERIC75 2014.08.11 23:42 

Hi,


   I would like to test my EAs on a past period (for instance from 01/01/2014 to 01/02/2014), but it seems that one can only make EAs that works at the present moment (with the int Start() function).


Any advice will be welcome :-)

Cheers

Aymeric

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.08.12 00:41  
Have you ever heard something called as Strategy Tester ?
AYMERIC75
112
AYMERIC75 2014.08.12 12:10  

Okay i didn't know such a think would exist, so i've test my EA based on Ichimoku technic, it suppose to display an arrow up when Ichimoku indicates a Buy signal and an arrow down when it indicates a sell signal, but i see no arrow on the graph, just the Ichimoku curves (and i didn't asked my EA to show those...)


Here is my code, feel free to test it...

//+------------------------------------------------------------------+
//|                                                         Ichi.mq4 |
//|                                                          AYMERIC |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "AYMERIC"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict


double Tenkan_value = iIchimoku(NULL, 0,9,26,52, MODE_TENKANSEN, 1);
double Kijun_value = iIchimoku(NULL,0,9,26,52, MODE_KIJUNSEN, 1);
double Chinkou_value =iIchimoku(NULL,0,9,26,52, MODE_CHINKOUSPAN, 1);
double senkouA=iIchimoku(NULL,0,9,26,52,3,1);
double senkouB=iIchimoku(NULL,0,9,26,52,4,1);

int count=0;



//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
int start()
{
  if (senkouA>=senkouB && Bid > senkouA && Chinkou_value> Bid)
  {
     if (Tenkan_value>=Kijun_value)
        {
         ObjectCreate(0,"fleche"+(string)count, NULL, OBJ_ARROW_BUY,0,Time[0], Bid);
        } 
  }
  else if (senkouA<=senkouB && Bid > senkouB && Chinkou_value> Bid)
  {
      if (Tenkan_value<=Kijun_value)
        {
         ObjectCreate(0,"fleche"+(string)count, NULL, OBJ_ARROW_SELL,0,Time[0], Bid);
        }
  
  }
  count ++;
     
return 0;
}
//+------------------------------------------------------------------+
/
To add comments, please log in or register