Foro Cazadores de Pips
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Me Gusta y Comparto
Get Adobe Flash player
Sistema EMM automatizado Aw
Palabras claves

curso  indicadores  luis  


Sistema EMM automatizado

3 participantes

Ir abajo

Sistema EMM automatizado Empty Sistema EMM automatizado

Mensaje  antoniomm91 Vie Ene 18, 2013 12:26 pm

Este es mi primer aporte y está basado en el sistema EMM que encontré en este mismo foro.

Básicamente lo que hice fue ingresar los parámetros en un EA para muestre una ALERTA con la oportunidad de compra o venta, es decir NO ABRE OPERACIONES, sólo alerta para que el usuario tome la decisión de abrir la operación.

Le he añadido a la estrategia el uso del Stochastic y desde luego son libres de modificar y "envenenar" el código para mejorarlo.

Sólo hay que crear un nuevo Expert con el nombre EMM y utilizar el siguiente código:

Código:
//+------------------------------------------------------------------+
//|                                                          EMM.mq4 |
//|                                                Copyright © 2012 |
//|                                  wwww.crearnegociovirtual.com  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012, Tony Martin"
#property link      "www.crearnegociovirtual.com"
  //---- Variables del MA RÁPIDO --------------------------------------+
extern string    ____MA_2____________;
extern int      FastMA_Period    = 9;      // MA Rápido
extern int      FastMA_Method    = 1;      // Tipo de MA Rápido: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      FastMA_Price      = 0;      // Precio del MA Rápido: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
  //---- Variables del MA LENTO ------------------------------------+
extern int      SlowMA_Period    = 26;    // MA Lento
extern int      SlowMA_Method    = 1;      // Tipo de MA Lento: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      SlowMA_Price      = 0;      // Precio del MA Lento: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
  //---- Parametros del RSI ---------------------------------------------+
extern string    _____RSI______________;
extern int      RSI_Period        = 14;    // periodo del RSI
extern int      RSI_Price        = 0;      // precio del RSI: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
extern int      RSI_BuyLevel      = 50;    // Valor límite del RSI para posiciones largas (para cortas usamos 100-RSI_BuyLevel)
extern int      RSI_SellLevel    = 40;    // Valor límite del RSI para posiciones largas (para cortas usamos 100-RSI_BuyLevel)
  //----  Parámetros Stochastic --------------------------------------+
extern string    ___Stochastic_________;
extern int      STOCH_Kperiod    = 10;    // período de línea %K
extern int      STOCH_Dperiod    = 3;      // periodo de línea %D
extern int      STOCH_slowing    = 3;      // Lentitud
extern int      STOCH_method      = 0;      // Tipo de Stoch: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      STOCH_price_field = 0;      // Tipo de precio: 0 - Low/High, 1 - Close/Close
extern int      STOCH_overbought  = 80;    // Valor límite del Stochastic. Si es mayor que STOCH_overbought Estamos en la zona de "sobrevendido"
//----- Variables Globales ---------------------------------------+
static string  symbol;
static int      shift = 0;
static int      STOCH_oversold;
static bool    Alerted;
static datetime Tiempo;

int init()
  {
      symbol        = Symbol();
      STOCH_oversold = 100 - STOCH_overbought;
      Alerted      = false;
      Tiempo = TimeCurrent();
      return(0);
  }

int start()
  {
      if ((Alerted == false) && (Tiempo < (TimeCurrent() + (Period() * 60))))
        {
            double rsi_0 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift);
            double rsi_1 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift+1);
            //---- Señal Principal --------------------------------------------+
            double fast_ma_0 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift);
            double fast_ma_1 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+1);
            double slow_ma_0 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift);
            double slow_ma_1 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+1);
            int trade_signal = 0;
            if(slow_ma_1 >= fast_ma_1 && slow_ma_0 < fast_ma_0) trade_signal++;
            if(slow_ma_1 <= fast_ma_1 && slow_ma_0 > fast_ma_0) trade_signal--;
            //----  Stochastic -----------------------------------------+
            double STOCHmain_0  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift);
            double STOCHmain_1  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+1);
            double STOCHsignal_0 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift);
            double STOCHsignal_1 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+1);
            if(trade_signal == 0) return(0);
            //---- Señal de Compra ------------------------------------------+
            if((rsi_0 > RSI_BuyLevel)          && (rsi_0 > rsi_1)                  &&
              (STOCHmain_0 > STOCHmain_1      || STOCHsignal_0 > STOCHsignal_1)    &&
              (STOCHmain_0 < STOCH_overbought || STOCHsignal_0 < STOCH_overbought) &&
              (Bid > fast_ma_0                && Bid > slow_ma_0))
              {
                  Alert("EMM: Comprar. ", Symbol(), " Período: ", Period(), " Precio: ", Bid, "/", Ask);
                  Alerted = true;
                  Tiempo = TimeCurrent();
              } 
            //---- Señal de Venta ------------------------------------------+
            else
              {
                  if((rsi_0 < RSI_SellLevel)      && (rsi_0 < rsi_1)                &&
                    (STOCHmain_0 < STOCHmain_1    || STOCHsignal_0 < STOCHsignal_1)  &&
                    (STOCHmain_0 > STOCH_oversold || STOCHsignal_0 > STOCH_oversold) &&
                    (Ask < fast_ma_0              && Ask < slow_ma_0))
                        {
                          Alert("EMM: Vender. ", Symbol(), " Período: ", Period(), " Precio: ", Bid, "/", Ask);
                          Alerted = true;
                          Tiempo = TimeCurrent();
                        } 
              }
        }
  }     
//+------------------------------------------------------------------+

Si desean que el sistema alerte sólo después del cierre de la vela se pueden modificar las siguientes líneas de esta forma:

Código:
double rsi_0 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift);
            double rsi_1 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift+1);
            //---- Señal Principal --------------------------------------------+
            double fast_ma_0 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+1);
            double fast_ma_1 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+2);
            double slow_ma_0 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+1);
            double slow_ma_1 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+2);

double STOCHmain_0  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+1);
            double STOCHmain_1  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+2);
            double STOCHsignal_0 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+1);
            double STOCHsignal_1 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+2);

Siempre será más confiable en timeframes más altos, sin embargo el sistema por lo general tiene un margen de acierto de 60%.

Esta estrategia me gusta porque el stoploss se establece muy corto y el takeprofit muy grande.

La configuración y descripción la pueden encontrar aquí [Tienes que estar registrado y conectado para ver este vínculo]
antoniomm91
antoniomm91
Soy Nuevito

Temas Temas : 20
Fecha de inscripción Fecha de inscripción : 20/10/2012
Localización Localización : Santiago, Chile

http://www.crearnegociovirtual.com

Volver arriba Ir abajo

Sistema EMM automatizado Empty Re: Sistema EMM automatizado

Mensaje  karl20 Vie Ene 18, 2013 7:24 pm

antoniomm91 escribió:Este es mi primer aporte y está basado en el sistema EMM que encontré en este mismo foro.

Básicamente lo que hice fue ingresar los parámetros en un EA para muestre una ALERTA con la oportunidad de compra o venta, es decir NO ABRE OPERACIONES, sólo alerta para que el usuario tome la decisión de abrir la operación.

Le he añadido a la estrategia el uso del Stochastic y desde luego son libres de modificar y "envenenar" el código para mejorarlo.

Sólo hay que crear un nuevo Expert con el nombre EMM y utilizar el siguiente código:

Código:
//+------------------------------------------------------------------+
//|                                                          EMM.mq4 |
//|                                                Copyright ©️ 2012 |
//|                                  wwww.crearnegociovirtual.com  |
//+------------------------------------------------------------------+
#property copyright "Copyright ©️ 2012, Tony Martin"
#property link      "www.crearnegociovirtual.com"
  //---- Variables del MA RÁPIDO --------------------------------------+
extern string    ____MA_2____________;
extern int      FastMA_Period    = 9;      // MA Rápido
extern int      FastMA_Method    = 1;      // Tipo de MA Rápido: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      FastMA_Price      = 0;      // Precio del MA Rápido: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
  //---- Variables del MA LENTO ------------------------------------+
extern int      SlowMA_Period    = 26;    // MA Lento
extern int      SlowMA_Method    = 1;      // Tipo de MA Lento: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      SlowMA_Price      = 0;      // Precio del MA Lento: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
  //---- Parametros del RSI ---------------------------------------------+
extern string    _____RSI______________;
extern int      RSI_Period        = 14;    // periodo del RSI
extern int      RSI_Price        = 0;      // precio del RSI: 0-6 PRICE_CLOSE,PRICE_OPEN,PRICE_HIGH,PRICE_LOW,PRICE_MEDIAN,PRICE_TYPICAL,PRICE_WEIGHTED
extern int      RSI_BuyLevel      = 50;    // Valor límite del RSI para posiciones largas (para cortas usamos 100-RSI_BuyLevel)
extern int      RSI_SellLevel    = 40;    // Valor límite del RSI para posiciones largas (para cortas usamos 100-RSI_BuyLevel)
  //----  Parámetros Stochastic --------------------------------------+
extern string    ___Stochastic_________;
extern int      STOCH_Kperiod    = 10;    // período de línea %K
extern int      STOCH_Dperiod    = 3;      // periodo de línea %D
extern int      STOCH_slowing    = 3;      // Lentitud
extern int      STOCH_method      = 0;      // Tipo de Stoch: 0-Simple, 1-Exponential, 2-Smoothed, 3-Weighted
extern int      STOCH_price_field = 0;      // Tipo de precio: 0 - Low/High, 1 - Close/Close
extern int      STOCH_overbought  = 80;    // Valor límite del Stochastic. Si es mayor que STOCH_overbought Estamos en la zona de "sobrevendido"
//----- Variables Globales ---------------------------------------+
static string  symbol;
static int      shift = 0;
static int      STOCH_oversold;
static bool    Alerted;
static datetime Tiempo;

int init()
  {
      symbol        = Symbol();
      STOCH_oversold = 100 - STOCH_overbought;
      Alerted      = false;
      Tiempo = TimeCurrent();
      return(0);
  }

int start()
  {
      if ((Alerted == false) && (Tiempo < (TimeCurrent() + (Period() * 60))))
        {
            double rsi_0 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift);
            double rsi_1 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift+1);
            //---- Señal Principal --------------------------------------------+
            double fast_ma_0 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift);
            double fast_ma_1 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+1);
            double slow_ma_0 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift);
            double slow_ma_1 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+1);
            int trade_signal = 0;
            if(slow_ma_1 >= fast_ma_1 && slow_ma_0 < fast_ma_0) trade_signal++;
            if(slow_ma_1 <= fast_ma_1 && slow_ma_0 > fast_ma_0) trade_signal--;
            //----  Stochastic -----------------------------------------+
            double STOCHmain_0  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift);
            double STOCHmain_1  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+1);
            double STOCHsignal_0 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift);
            double STOCHsignal_1 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+1);
            if(trade_signal == 0) return(0);
            //---- Señal de Compra ------------------------------------------+
            if((rsi_0 > RSI_BuyLevel)          && (rsi_0 > rsi_1)                  &&
              (STOCHmain_0 > STOCHmain_1      || STOCHsignal_0 > STOCHsignal_1)    &&
              (STOCHmain_0 < STOCH_overbought || STOCHsignal_0 < STOCH_overbought) &&
              (Bid > fast_ma_0                && Bid > slow_ma_0))
              {
                  Alert("EMM: Comprar. ", Symbol(), " Período: ", Period(), " Precio: ", Bid, "/", Ask);
                  Alerted = true;
                  Tiempo = TimeCurrent();
              } 
            //---- Señal de Venta ------------------------------------------+
            else
              {
                  if((rsi_0 < RSI_SellLevel)      && (rsi_0 < rsi_1)                &&
                    (STOCHmain_0 < STOCHmain_1    || STOCHsignal_0 < STOCHsignal_1)  &&
                    (STOCHmain_0 > STOCH_oversold || STOCHsignal_0 > STOCH_oversold) &&
                    (Ask < fast_ma_0              && Ask < slow_ma_0))
                        {
                          Alert("EMM: Vender. ", Symbol(), " Período: ", Period(), " Precio: ", Bid, "/", Ask);
                          Alerted = true;
                          Tiempo = TimeCurrent();
                        } 
              }
        }
  }     
//+------------------------------------------------------------------+

Si desean que el sistema alerte sólo después del cierre de la vela se pueden modificar las siguientes líneas de esta forma:

Código:
double rsi_0 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift);
            double rsi_1 = iRSI(NULL, 0, RSI_Period, RSI_Price, shift+1);
            //---- Señal Principal --------------------------------------------+
            double fast_ma_0 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+1);
            double fast_ma_1 = iMA(NULL, 0, FastMA_Period, 0,  FastMA_Method, FastMA_Price, shift+2);
            double slow_ma_0 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+1);
            double slow_ma_1 = iMA(NULL, 0, SlowMA_Period, 12, SlowMA_Method, SlowMA_Price, shift+2);

double STOCHmain_0  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+1);
            double STOCHmain_1  = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_MAIN,  shift+2);
            double STOCHsignal_0 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+1);
            double STOCHsignal_1 = iStochastic(NULL,0,STOCH_Kperiod,STOCH_Dperiod,STOCH_slowing,STOCH_method,STOCH_price_field,MODE_SIGNAL,shift+2);

Siempre será más confiable en timeframes más altos, sin embargo el sistema por lo general tiene un margen de acierto de 60%.

Esta estrategia me gusta porque el stoploss se establece muy corto y el takeprofit muy grande.

La configuración y descripción la pueden encontrar aquí [Tienes que estar registrado y conectado para ver este vínculo]

El archivo no se puede leer, tiene una clave por fa publicalo. grazie
karl20
karl20
Cazador avanzado

Temas Temas : 325
Fecha de inscripción Fecha de inscripción : 05/08/2011

Volver arriba Ir abajo

Sistema EMM automatizado Empty Re: Sistema EMM automatizado

Mensaje  jorgebaq Sáb Ene 19, 2013 8:34 am

Amigos: recuerdo que la clave es:

cazapips

HUBO UN CRESE DE LAS EMAS Y NO ME DIO ALERTA, HAY QUE CAMBIAR ALGO EN EL EA ????

SALUDOS,

JORGE BAQUERO

jorgebaq
Cazador Activo

Temas Temas : 119
Fecha de inscripción Fecha de inscripción : 06/07/2012

Volver arriba Ir abajo

Sistema EMM automatizado Empty Es por los filtros

Mensaje  antoniomm91 Sáb Ene 19, 2013 9:37 am

Si se produjo un cruce de EMA's y no te dio alerta es porque no se cumplen todas las condiciones. Recuerda que el RSI debe estar en la zona de compra y el las líneas del Stochastic deben estar subiendo al igual que el RSI, además alguna de las líneas del Stochastic debe estar fuera de la zona de sobrecompra o sobreventa para reducir el riesgo de un giro rápido de la tendencia.

Todos esos parámetros los puedes cambiar, si necesitas ayuda sólo pregunta.
antoniomm91
antoniomm91
Soy Nuevito

Temas Temas : 20
Fecha de inscripción Fecha de inscripción : 20/10/2012
Localización Localización : Santiago, Chile

http://www.crearnegociovirtual.com

Volver arriba Ir abajo

Sistema EMM automatizado Empty Re: Sistema EMM automatizado

Mensaje  jorgebaq Sáb Ene 19, 2013 10:34 am

MUCHAS GRACIAS POR LA EXPLICACION, Y MUCHOS EXITOS

prof prof prof

jorgebaq
Cazador Activo

Temas Temas : 119
Fecha de inscripción Fecha de inscripción : 06/07/2012

Volver arriba Ir abajo

Sistema EMM automatizado Empty Re: Sistema EMM automatizado

Mensaje  Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.