[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 273

 
Urain >> :

I guess all the newbies know everything :o)

No. The old Soviet habit of not getting in line but getting through to the window itself is still alive. :))

 

How to test an EA on real quotes?

_____________________________________________

Good afternoon friends.


Can you please tell me how to solve this problem.


I have written an Expert Advisor and I want to test it on quotes in real time.


Is it possible to test the Expert Advisor on "real" quotes so that the terminal is not always open (the computer is not always running)?


The matter is that the Expert Advisor is designed mainly for H4, and to get a decent amount of trades for analysis - the terminal must be running 24 hours a day, and therefore the computer must be running 24 hours a day for at least a week ...

This, for obvious reasons, is not entirely comfortable...


That is, is it possible to "transfer" testing from my machine, but, at the same time, to test on real, not historical data?


Thank you very much in advance.
 
In general, of course, if you are testing it on a demo, it does not matter - optimize it on the history, then turn it off for a month, and then see in the tester what your brainchild can do on new quotes. The possibility of bringing the strategy to a remote server is not yet available in Metatrader.
 
alsu >> :
If you want to see how the Expert Advisor works in real time, the terminal should certainly be enabled. The possibility of sending the strategy to a remote server is absent in MetaTrader.

You may rent a server, install a virtual machine, put MT on it and the server will be online all day long (search for it on the forum, it has already been discussed).

 
It's unhygienic - they'll steal the strategy!))
 
Morzh09 >> :

How do you test an EA on real quotes?

_____________________________________________

Friends, good afternoon.


Please advise how to solve this problem.


I've written an Expert Advisor and I want to test it on real time quotes.


Is it possible to test the Expert Advisor on "real" quotes so that the terminal is not always open (the computer is not always running)?


The thing is that the Expert Advisor is designed mainly for H4, and to get a decent amount of trades for analysis - the terminal must be running 24 hours a day, and therefore the computer must be running 24 hours a day for at least a week ...

This, for obvious reasons, is not entirely comfortable...


That is, is it possible to "transfer" testing from my machine, but, at the same time, so that the testing takes place on real, not historical data?


Thank you very much in advance.

Roughly speaking in a week all your "real" data will be historical (which won't prevent it from remaining real), what prevents you from doing a run in the tester? Although renting a virtual server is also an option for such cases.

In general, the problem is seen only in your understanding of the problem. If you need to assess the strategy, the tester is enough, if the glitches in the real work, the small gaps in the work will not be a particular hindrance to the assessment.

I have two computers running non-stop around the clock, the reasons are absolutely unclear, what kind of comfort are you talking about?

If your computer is noisy you can buy an asus 700 netbook, it's a penny now, and let it run without shutting down.

 

Hello. I just happened to come across an article on a subject that interests me. Namely this: Choosing a window size. .... Optimal results are achieved

in the case of selecting a window size of the order of the fractal dimension of the data. In order to calculate it, we should "slice" the series with a sliding window of a sufficiently large size

(see Figure 5 ), and then calculate the fractal dimensionality of the resulting data using, for example, Box-count method....

Please advise (preferably simpler), how to calculate the size of this sliding window. Or at least where to look at it.

 
Piboli >> :

Hello. I just happened to come across an article on a subject that interests me. Namely this: Choosing a window size. .... Optimal results are achieved

in the case of selecting a window size of the order of the fractal dimension of the data. In order to calculate it, we should "slice" the series with a sliding window of sufficiently large size

(see Figure 5 ), and then calculate the fractal dimensionality of the resulting data using, for example, Box-count method....

Please advise (preferably simpler), how to calculate the size of this sliding window. Or at least where to look at it.

Do not hesitate to start a topic with this question, I think it will be more helpful,

The same topic is organised for elementary and slightly more complicated programming questions.

 
Urain писал(а) >>

Do not hesitate to start a topic with this question, I think it will be more helpful,

The same topic is organised for elementary and slightly more complicated programming questions.

I wanted to suggest creating a separate topic too. But I refused.

 

Hello.

There is an expert SimpleMA, I tweaked it a little for me, just a little ...:-))) and called MASimple_v2x.

//+------------------------------------------------------------------+
//|                                                 MASimple_v2x.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//---- input parameters
extern int       MAFP=10;
extern int       MASP=20;
extern double    Lots=0.1;
extern int       MagicNumber=123456;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
    
bool CheckOrders(int Type)
{
 bool Result= True;
 for(int i=0; i<OrdersTotal(); i++)
  if(OrderSelect( i, SELECT_BY_POS))
   if(OrderMagicNumber()== MagicNumber && OrderSymbol() == Symbol())
      if(OrderType()== Type)
        {
         if( Type==OP_BUY)
           if(!OrderClose(OrderTicket(),OrderLots(),Bid,0))
             Result= False;
         if( Type==OP_SELL)
           if(!OrderClose(OrderTicket(),OrderLots(),Ask,0))
             Result= False;
         } 
        else Result= False;
 return( Result); 
}

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
    double MAF_0 =iMA(NULL, 0, MAFP,0,1,1,0);
    double MAF_1 =iMA(NULL, 0, MAFP,0,1,1,1);
    double MAS_0 =iMA(NULL, 0, MASP,0,1,1,0);
    double MAS_1 =iMA(NULL, 0, MASP,0,1,1,1);
    
    if( MAF_1 < MAS_1 && MAF_0 > MAS_0)
     if( CheckOrders(OP_SELL))//продажа
      {
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 10, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
       
    if( MAF_1 > MAS_1 && MAF_0 < MAS_0)
     if( CheckOrders(OP_BUY))//покупка
      {
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 10, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

then i tried to improve it BUT BUT

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
    double MAF_0 =iMA(NULL, 0, MAFP,0,1,1,0);
    double MAF_1 =iMA(NULL, 0, MAFP,0,1,1,1);
    double MAS_0 =iMA(NULL, 0, MASP,0,1,1,0);
    double MAS_1 =iMA(NULL, 0, MASP,0,1,1,1);
    
    if MAF_0 - MAF_1= A
    if MAS_0 - MAS_1= B
    
    if( A <0 && B <0)
     if( CheckOrders(OP_SELL))//продажа
      {
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 10, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
       
    if( A >0 && B >0)
     if( CheckOrders(OP_BUY))//покупка
      {
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 10, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

I got an error after experimenting

'A' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (65, 23)
'B' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (66, 23)
'A' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (68, 9)
'B' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (68, 17)
'A' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (75, 9)
'B' - variable not defined	C:\Program Files\MetaTrader - Alpari\experts\MASimple_v2x_1. mq4 (75, 17)

WHAT DID I DO WRONG?????????????

Thanks in advance

Reason: