[¡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 400

 
Bihkul:

Puede alguien decirme dónde poner el número de cuenta para que el EA funcione sólo en esta cuenta respectivamente.

int inicio()

{

if(¡Número de cuenta()!=123) return(0);

Gracias de antemano por su ayuda.

 

¿Quién puede explicar por qué en el código

int start() // Función especial start
{
double proc=0;
int i; // Número de barra
double Minimum=Bid, // Precio mínimo
Maximum=Bid; // Precio máximo

for(i=0;i<=50-1;i++) // De cero (!) a.
¡{ // ...Quant_Bars-1 (!)
if (Low[i]< Minimum) // si < conocido
Minimum=Low[i]; // será min
if (High[i]> Maximum) // si > conocido
Maximum=High[i]; // será max
}

double seredina = (Minimum+Maximum)/2;
proc=(Maximum-Minimum);
Comment("Precio máximo==",Máximo,
"\n", "Precio mínimo==",Mínimo,
"\n", "medio==",seredina,
"\n", "Porcentaje=30",proc);
return; // Salir de start()

}

proc es igual a 300,0012 aunque proc es el máximo menos el mínimo

con el máximo correcto, el mínimo correcto y el medio correcto.

???????

Sin embargo, si hago proc=2+2;

¡¡¡¡¡el terminal responde con 304 !!!!! ¿Cuál es el problema? ?????

 
VOLDEMAR:

"\n","Процент=30",proc);
return; // salir de start()

Al mismo tiempo, si hago proc=2+2;

¡¡¡¡¡el terminal responde con un 304 !!!!! ¿Cuál es el problema? ?????

divertidísimo :)
 

Por favor, dígame por qué el probador no optimiza el Asesor Experto

Selecciono varios parámetros de entrada, marco una casilla para optimizar ... Presiono el botón de inicio La optimización termina rápidamente y me da 1/1, el diario dice Se han realizado 1 pases durante la optimización, 1 resultados han sido descartados por ser insignificantes

Lo he probado en 5 terminales de broker diferentes, por favor, aconséjenme qué estoy haciendo mal.

 
Hola a todos, Me podéis aconsejar, la tarea es hacer PlaySound cuando aparece una orden con beneficio > 0 en los historiales. Aparentemente algo como if ((OrderCloseTime == hora actual) &&(OrderProfit > 0)), pero no puedo averiguar cómo escribirlo (comparando la hora de cierre con la hora actual). Por favor, ayuda.
 
Pyro:
Hola a todos, Me pueden aconsejar, la tarea es hacer PlaySound cuando una orden con beneficio > 0 aparece en los historiales. Aparentemente algo como if ((OrderCloseTime == hora actual) &&(OrderProfit > 0)), pero no consigo averiguar cómo escribirlo (comparando la hora de cierre con la hora actual). Por favor, ayuda.
//ф-ция выдает время последнего закрытого ордера. при желании все действия можно провести здесь
datetime OrderCloseTime_() //void
  {
   datetime Time_=0;
   for(int i=0;i<OrdersHistoryTotal();i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)break;
      if(OrderSymbol()==Symbol())  //if(OrderProfit()>0)
        {
         if(OrderCloseTime()>Time_)Time_=OrderCloseTime();

        }
     }
     
   //if(Time_==Time[0]) PlaySound(....);  
   return(Time_);//
 }
 

Sabes, he actualizado los bocetos iniciales del primer capítulo del EA, y ahora el compilador jura, no son paréntesis equilibrados, no sé inglés, pero jura así

'\end_of_program' - ending bracket '}' expected C:³³ MF Trader 4\documents³experts³ for lavin.mq4 (59, 1)

'\ fin_del_programa' - paréntesis izquierdo desequilibrado C:\Form MF Trader 4/CDocuments/experts/ para Levine.mq4 (59, 1)

Estaría bien, los paréntesis están equilibrados, ¡los estoy recalculando uno a uno! Muchas veces. 10 veces el viernes, y tres veces hoy.

Amigos, ¡¡¡ayuda!!! O soy estúpido, o hay un problema más profundo, ¡por favor!

Código

//+------------------------------------------------------------------+
//|                                                    для лавин.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);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
 int tiket,tikett;double volume=0.1;int i=0,R1=0,R2=0,A=1 ;double price=PRICE_OPEN;
   //  R1=((PRICE_OPEN- stoploss*Point)*stoploss)/stoploss;R2=((PRICE_OPEN+ stoploss*Point)*stoploss)/stoploss;
     
     
int start()
  {       int X,Y; double price=(Ask+Bid)/2;            
//----
       Alert ("OrdersTotal()",OrdersTotal());

if(OrderSymbol()==Symbol()&&OrderMagicNumber( )==1000{
 for(int i=OrdersTotal();i==0;i--){
OrderSelect(i,SELECT_BY_POS );if(OrderType( )!=OP_BUYSTOP){X++}}};if (X==0){


   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( )); }
   
if( OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol()&& OrderType( ) !=OP_SELLSTOP) { 
   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( )); 
    }       
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
if(OrderSymbol()==Symbol()&&OrderMagicNumber( )==1000ТУТ надо закрыть скобку условия{


{X++;точка с запятой}
 
Jesús, debe ser un punto y coma, los paréntesis están equilibrados, hay exactamente ocho. Lo arreglaré.
 

Nah, movido el punto y coma dentro de los paréntesis por supuesto, jura así

'\ fin_del_programa' - paréntesis izquierdo desbalanceado C:\TradeFormat MF Trader 4\documentos\perts\ para el lavin.mq4 (59, 1)