Hola a todos. Necesito ayuda con el código pegado a continuación. Es una alerta cruzada de promedio móvil simple que modifiqué un poco y agregué una alerta por correo electrónico. No estoy seguro de si la alerta por correo electrónico funcionará ya que sigo recibiendo 1 error cuando compilo. He pegado el código a continuación

He revisado el código varias veces y parece que no puedo identificar el problema. Gracias de antemano por su ayuda.

El error dice ... '\ end_of_program' - paréntesis izquierdo desequilibrado



// ----------------------------------------------- -------------------
//| MACrossEarlyAlert.mq4 |
//| Mariano Silva |
//| |
// ----------------------------------------------- -------------------
#property copyright Mariano Silva
#property link

#property indior_chart_window
//---- parámetros de entrada
extern bool EmailAlert = falso;
extern int FastMAPeriod = 50;
Cadena externa Tipo = 0-SMA, 1-EMA;
extern int FastMAType = 1;
extern int SlowMAPeriod = 1;
extern int SlowMAType = 0;
extern int EarlyPips = 15;
extern int ResetAlert = 20;
color externo LineColor = Naranja;
// ----------------------------------------------- -------------------
//| Función de inicialización del indicador personalizado |
// ----------------------------------------------- -------------------
int init ()
{
//---- indicadores
//----
return (0);
}
// ----------------------------------------------- -------------------
//| Función de desinitialización del indicador personalizado |
// ----------------------------------------------- -------------------
int deinit ()
{
string LineName;
//----
LineName = StringConenate (FastMAPeriod,, SlowMAPeriod, MA Cross);
ObjectDelete (LineName);
//----
return (0);
}
// ----------------------------------------------- -------------------
//| Función de iteración del indicador personalizado |
// ----------------------------------------------- -------------------
int start ()
{
//int counted_bars = IndiorCounted ();

FastMALastBar doble, SlowMALastBar, PriceToCross, Cross, FastMATest, SlowMATest;
bool AlertEnabled = true;
string LineName = StringConenate (FastMAPeriod,, SlowMAPeriod, MA Cross);


//LineName = StringConenate (FastMAPeriod,, SlowMAPeriod, MA Cross);

//----

if (NewBar ())
{
FastMALastBar = iMA (NULL, 0, FastMAPeriod, 0, FastMAType, PRICE_CLOSE, 1);
SlowMALastBar = iMA (NULL, 0, SlowMAPeriod, 0, SlowMAType, PRICE_CLOSE, 1);
PriceToCross = Abierto [0];
Cross = FastMALastBar-SlowMALastBar;


if (Crossgt; 0.0)
{
while (Crossgt; 0.0)
{
PriceToCross = PriceToCross-Point;
FastMATest = CalcMA (FastMAPeriod, FastMAType, PriceToCross, FastMALastBar);
SlowMATest = CalcMA (SlowMAPeriod, SlowMAType, PriceToCross, SlowMALastBar);
Cross = FastMATest-SlowMATest;
}
}
más
{
mientras (Crosslt; 0.0)
{
PriceToCross = PriceToCross Point;
FastMATest = CalcMA (FastMAPeriod, FastMAType, PriceToCross, FastMALastBar);
SlowMATest = CalcMA (SlowMAPeriod, SlowMAType, PriceToCross, SlowMALastBar);
Cross = FastMATest-SlowMATest;
}
}


ObjectDelete (LineName);
drawLine (PriceToCross, LineName, LineColor, 0);

}

if (AlertEnabled)
{
if (MathAbs (Close [0] -PriceToCross) lt; = EarlyPips * Point)
{
Alert (Cerca de, FastMAPeriod,, SlowMAPeriod, MA Cross on, Symbol (),, Period ());

si EmailAlert SendMail (Close to, FastMAPeriod,, SlowMAPeriod, MA Cross on, Symbol (),, Period ();

AlertEnabled = falso;
}
}
más
{
if (MathAbs (Close [0] -PriceToCross) gt; = ResetAlert * Point)
{
AlertEnabled = verdadero;
}
}





//----
return (0);
}
// ----------------------------------------------- -------------------


doble CalcMA (int MAPeriod, int MAType, double PriceTest, double LastMA)
{
doble MA, pr;

cambiar (MAType)
{
caso 0:
{
MA = ((LastMA * MAPeriod) -Close [MAPeriod] PriceTest)MAPeriod;
descanso;
}
caso 1:
{
pr = 2.0(MAPeriod 1);
MA = PriceTest * pr LastMA * (1-pr);
descanso;
}
}

return (MA);
}

void drawLine (double lvl, nombre de la cadena, color Col, tipo int)
{
ObjectCreate (name, OBJ_HLINE, 0, Time [0], lvl);/, Time [0], lvl);

if (tipo == 1)
ObjectSet (name, OBJPROP_STYLE, STYLE_SOLID);
más
ObjectSet (nombre, OBJPROP_STYLE, STYLE_DOT);

ObjectSet (name, OBJPROP_COLOR, Col);
ObjectSet (nombre, OBJPROP_WIDTH, 1);

regreso;
}


bool NewBar () {
static datetime lastbar;
datetime curbar = Tiempo [0];
if (lastbar! = curbar)
{
lastbar = curbar;
retorno (verdadero);
}
else {
falso retorno);
}
}