[¡Archivo!] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no lo dejéis pasar. No podría ir a ningún sitio sin ti - 2. - página 529

 
001:
¿Puede decirme si existe un auto-optimizador que optimice los parámetros durante la prueba? Tengo que comprobar la idea.
Incluso hay uno más cercano, justo en nuestro sitio.
Y también existe la búsqueda, que es cuando se introducen en un buscador las palabras con las que se nombra el tema.
http://www.google.ru/search?as_sitesearch=mql4.com&as_q=автооптимизатор
 

¿Podría aconsejar cómo especificar correctamente en una orden pendiente en un EA para que se elimine automáticamente a las 23:00?

Esta opción da un error:

  datetime Tim=D'23:00';
   int    Cur_Hour=Hour();             // Серверное время в часах   
   double Cur_Min =Minute();           // Серверное время в минутах   
   double Cur_time= Cur_Hour + Cur_Min/100; // Текущее время   
   if (Cur_time>=20.00&&Cur_time<=20.00&&order==false)
  {

ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Bid-Spread,2,Bid-Spread-SL,Bid, Tim);
 
Andreev:

¿Podría aconsejar cómo especificar correctamente en una orden pendiente en un EA para que se elimine automáticamente a las 23:00?

Esta opción da un error:


int Tim=iTime(NULL, Period_D1,0)+23*60*60;
ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Bid-Spread,2,Bid-Spread-SL,Bid, Tim);
Algo así
 
dmmikl86:

No soy un programador novato desde hace unos años, reescribí el indicador desde otro lenguaje y me encontré con un redibujado.

Soy un principiante, he reescrito el indicador en otro idioma:


Preferiría tener el indicador como un archivo. Nadie va a pegar las piezas en un archivo
 
Andreev:

Esta opción da un error:

int Tim;
   int    Cur_Hour=Hour();             // Серверное время в часах   
   double Cur_Min =Minute();           // Серверное время в минутах   
   double Cur_time= Cur_Hour + Cur_Min/100; // Текущее время   
   if (Cur_time>=20.00&&Cur_time<=20.00&&order==false)
  { Tim=TimeCurrent( )+ (23-Cur_time)*3600

ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Bid-Spread,2,Bid-Spread-SL,Bid, Tim);


Algo así.
 
Vinin:

Algo así

Da un error:


2011.07.19 18:56:15 2011.07.18 20:00 Retorno EURUSD,M1: OrderSend error 4062
2011.07.19 18:56:15 2011.07.18 20:00 Retorno: el parámetro de comentario para la función OrderSend debe ser una cadena

 
alexshell:

Así es.

Por alguna razón me da el mismo error. Si quito la función Tim de la orden, funciona, pero algunas operaciones se abren después de las 23.00. ¿Qué puedo hacer para limitarlo?
 
Andreev:

Tengo un error:


2011.07.19 18:56:15 2011.07.18 20:00 Retorno EURUSD,M1: OrderSend error 4062
2011.07.19 18:56:15 2011.07.18 20:00 Retorno: el parámetro de comentario para la función OrderSend debe ser una cadena


Lo siento, he editado tu versión sin comprobarlo

 ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Bid-Spread,2,Bid-Spread-SL,Bid, "",0,Tim, CLR_NONE);
 
Vinin:


Lo siento, he editado tu versión sin comprobarlo


¡¡¡Muchas gracias!!! Funciona :)
 

Buenas noches!!! Tengo una pregunta sobre la función de Alerta. Aquí hay un robot sin un gran trozo de medio y muchos h

//+------------------------------------------------------------------+
//|                                                    пробныйй .mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
extern double stoploss=0; extern double takeprofit=20;extern int otstup=20; extern datetime expiration=0;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
  
  
  int tiket,tikett;double volume=0.1;int i=0,R1=0,R2=0,A=1 ;double price; int stsBUY;int stsSELL;double Price;int C=0;datetime wremjapomnim;
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {int X,Y; double price=NormalizeDouble((Ask+Bid)/2,4) ; Alert ("price", price);Alert("otstup*Point",otstup*Point);
//----
Alert ("Price +otstup*Point",Price +otstup*Point);Alert ("Price+takeprofit*Point+otstup*Point", Price+takeprofit*Point+otstup*Point);
tiket= OrderSend( Symbol(), OP_BUYSTOP,  volume*A, Price +otstup*Point, Point* 3, R1, Price+takeprofit*Point+otstup*Point, "OP_BUYSTOP", 1000,  expiration, Red); 
   Alert ("OP_BUYSTOP", GetLastError( ));
  Alert ("Price -otstup*Point",Price -otstup*Point);Alert ("Price-takeprofit*Point-otstup*Point", Price-takeprofit*Point-otstup*Point); 
tikett= OrderSend( Symbol(), OP_SELLSTOP,  volume*A, Price -otstup*Point, Point* 3,R2, Price-takeprofit*Point-otstup*Point, "OP_SELLSTOP" , 2000,  expiration,C'0,128,255' );
    Alert ("OP_SELLSTOP", GetLastError( )); 
   
//----

// Здесь код для закрытия всех открытых позиций (тоже в цикле)
         for ( i=0; i<OrdersTotal(); i++) {
           OrderSelect(i, SELECT_BY_POS );
              if (  OrderType( )==OP_BUY && OrderType( )==OP_SELL ){
                          OrderClose( OrderTicket( ), OrderLots( ), OrderClosePrice( ) , 0, CLR_NONE);
   Alert ("OrderClose-vse-2",  GetLastError( ) ); C=0;A=1; }} 
         // Здесь код для удаления всех отложенных ордеров (также в цикле)
         for ( i=0; i<OrdersTotal(); i++) {
         OrderSelect(i, SELECT_BY_POS );
           if (  OrderType( )==OP_BUYSTOP && OrderType( )==OP_SELLSTOP ){ 
            OrderDelete(OrderTicket( )) ; Alert ("OrderDelete-vse-2",  GetLastError( ) ); }}    
        
   return(0);
  }
//+------------------------------------------------------------------+
Alert debería registrar el precioAlert ("precio", precio); digamos 1,4825, y lo hace, es decir, la variable es normal. ¡¡¡Y entonces!!!

Alert ("Precio +otstup*Punto",Precio +otstup*Punto); Es Precio + sangría(20pp)* multiplicar por un punto(0.0001) total-1.4805 debería ser, (!!!!) pero escribe 0.002

etc. Aquí: ¿Cómo lo entiendo? ¿Cuál es la sintaxis de las fórmulas?