Redactaré un asesor de forma gratuita - página 112

 
¡Buena salud para todos! A juzgar por los comentarios en el foro sobre mi pregunta de si es posible hacer un búho basado en líneas de colores de los indicadores habituales presentes en el gráfico, quedó claro por los comentarios - es posible. Es decir, por ejemplo, el verde se cruza con el azul, el azul se cruza con el rojo, etc. Y cuando estas condiciones coinciden, se da una orden en la dirección adecuada. ¿Por qué exactamente por las líneas? Porque un Asesor Experto de este tipo sería una gran ayudapara un trader principiante que experimenta mucho y comprueba numerosas teorías, y un Asesor Experto realmente valioso que ahorra tiempo y nervios. ¿Por qué mi mensaje está aquí, en la sección de EAs gratuitos? Porque seguramente será útil, si no para todos, para muchos. Adjunto una captura de pantalla para que se entienda mejor de lo que estoy hablando.
Archivos adjuntos:
o9b4dq-1.jpg  73 kb
 
Hola. ¿Hay alguna forma de automatizar la estrategia SniperX de Forex Academy?
 
Hola a todos, ¿podríais sugerir algo similar a esto --e-CloseByProfit- EA cerrará todas las posiciones cuando alcancen un nivel de beneficio o pérdida total predefinido --- sólo en MT5. Gracias.
 

Hola. Me pueden ayudar si tienen tiempo La pregunta es la siguiente, necesito que el EA abra una orden en cada señal de dos indicadores, (dan una señal cuando están en cierta combinación) en una palabra, debe haber varias órdenes para comprar o vender en el mercado, en consecuencia, de acuerdo a las señales de los indicadores. Pero sólo tengo una orden en el mercado y hasta que no se cierra no se abre la siguiente...... ¿Es una cuestión de recuento de órdenes? Por favor, dame una pista. Puedo enviarte el código si lo necesitas.

Muchas gracias de antemano.

 
danil77783:

Hola. Me pueden ayudar si tienen tiempo La pregunta es la siguiente, necesito que el EA abra una orden en cada señal de dos indicadores, (dan una señal cuando están en cierta combinación) en una palabra, debe haber varias órdenes para comprar o vender en el mercado, en consecuencia, de acuerdo a las señales de los indicadores. Pero sólo tengo una orden en el mercado y hasta que no se cierra no se abre la siguiente...... ¿Es una cuestión de recuento de órdenes? Por favor, dame una pista. Si lo necesitas, puedo enviarte el código.

Gracias de antemano.

Bueno, no puedes arreglar tu EA sin el código a menos que empieces a entender la programación. Lo más probable es que su EA esté escrito en la plantilla con 1 orden en el mercado y en realidad es muy difícil de corregir porque trabajar con múltiples órdenes y en diferentes criterios es muy diferente.

 
Pawel Egoshin:
Lo que necesitas es un EA, un martín normal con un aumento de tono.

¿No hay una única opción para Ilan? De hecho, hay una gran cantidad de estos plumíferos justo en el código abierto, pero probablemente hay que presentárselo en bandeja...

 
Sergey Martynov:

Por supuesto que ha pasado mucho tiempo, pero un vistazo rápido al código me dice que tengo que escribir el bot de nuevo, basado en la estrategia - porque no tiene sentido tantas llamadas al indicador, porque ya en la llamada se da el resultado de la comparación posterior, a menos que se calcule para una herramienta con 4 dígitos ANTES del punto decimal...

 
yuriy kovalchuk:
Hola, ¿puede sugerir algo similar a esto --e-CloseByProfit- EA cerrará todas las posiciones cuando llegue a un beneficio o pérdida total predefinido --- sólo en MT5. Gracias.

Algo así. Sólo tienes que introducir tu saldo + lo que quieres ganar

//+------------------------------------------------------------------+
//|                                                  CloseEquity.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//|                                          Close all if a loss.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//|                     https://www.mql5.com/ru/market/product/43516 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property link      "https://www.mql5.com/ru/market/product/43516"
#property version   "1.000"
/*
   barabashkakvn Trading engine 3.112
*/
#include <Trade\Trade.mqh>
#include <Trade\AccountInfo.mqh>
//---
CPositionInfo  m_position;                   // object of CPositionInfo class
CTrade         m_trade;                      // object of CTrade class
CAccountInfo   m_account;                    // object of CAccountInfo class
//--- input parameters
input double   InpProfit            = 150000;      // Profit Equity, in money
input bool     InpPrintLog          = false;       // Print log
input ulong    InpMagic             = 42967428;    // Magic number
//---
bool     m_stop                     = false;
int      ticks_to_close             = 1;           // количество тиков до снятия эксперта
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   m_trade.SetExpertMagicNumber(InpMagic);
   m_trade.SetMarginMode();
   m_trade.SetTypeFillingBySymbol(Symbol());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(AccountInfoDouble(ACCOUNT_EQUITY)>InpProfit)
     {
      if(IsPositionExists())
        {
         CloseAllPositions();
         return;
        }
      else
        {
         Alert("It is necessary to restart the adviser");
         ExpertRemoves();
         m_stop=true;
        }
     }
   if(m_stop)
      return;
//---
  }
//+------------------------------------------------------------------+
//| Is position exists                                               |
//+------------------------------------------------------------------+
bool IsPositionExists(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--)
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         return(true);
//---
   return(false);
  }
//+------------------------------------------------------------------+
//| Close all positions                                              |
//+------------------------------------------------------------------+
void CloseAllPositions(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(!m_trade.PositionClose(m_position.Ticket())) // close a position by the specified m_symbol
            if(InpPrintLog)
               Print(__FILE__," ",__FUNCTION__,", ERROR: ","CTrade.PositionClose ",m_position.Ticket());
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void ExpertRemoves(void)
  {
   static int tick_counter=0;
//---
   tick_counter++;
   Comment("\nДо выгрузки эксперта ",__FILE__," осталось ",
           (ticks_to_close-tick_counter)," тиков ");
//--- до
   if(tick_counter>=ticks_to_close)
     {
      ExpertRemove();
      Print(TimeCurrent(),": ",__FUNCTION__," эксперт будет выгружен");
     }
   Print("tick_counter = ",tick_counter);
//---
  }
//+------------------------------------------------------------------+
Archivos adjuntos:
CloseEquity.mq5  10 kb
 
Alexsandr San:

Algo así. Sólo tienes que poner tu balance + lo que quieras hacer.


No, eso es más fiable.

//+------------------------------------------------------------------+
//|                                                  CloseEquity.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//|                                          Close all if a loss.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//|                     https://www.mql5.com/ru/market/product/43516 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property link      "https://www.mql5.com/ru/market/product/43516"
#property version   "1.000"
/*
   barabashkakvn Trading engine 3.112
*/
#include <Trade\Trade.mqh>
#include <Trade\AccountInfo.mqh>
//---
CPositionInfo  m_position;                   // object of CPositionInfo class
CTrade         m_trade;                      // object of CTrade class
CAccountInfo   m_account;                    // object of CAccountInfo class
//--- input parameters
input string   Template             = "ADX";       // Имя шаблона(without '.tpl')
input double   InpProfit            = 150000;      // Profit Equity, in money
input bool     InpPrintLog          = false;       // Print log
input ulong    InpMagic             = 42967428;    // Magic number
//---
bool     m_stop                     = false;
int      ticks_to_close             = 1;           // количество тиков до снятия эксперта
uint     SLEEPTIME                  = 1;           // Время паузы между повторами в секундах
ENUM_TIMEFRAMES TimeFrame;                         // Change TimeFrame - Current = dont changed
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   m_trade.SetExpertMagicNumber(InpMagic);
   m_trade.SetMarginMode();
   m_trade.SetTypeFillingBySymbol(Symbol());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(AccountInfoDouble(ACCOUNT_EQUITY)>InpProfit)
     {
      if(IsPositionExists())
        {
         CloseAllPositions();
         Sleep(SLEEPTIME*1000);
         CloseAllPositions();
         return;
        }
      else
        {
         Alert("It is necessary to restart the adviser");
         ExpertRemoves();
         DeleteChart();
         m_stop=true;
        }
     }
   if(m_stop)
      return;
//---
  }
//+------------------------------------------------------------------+
//| Is position exists                                               |
//+------------------------------------------------------------------+
bool IsPositionExists(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--)
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         return(true);
//---
   return(false);
  }
//+------------------------------------------------------------------+
//| Close all positions                                              |
//+------------------------------------------------------------------+
void CloseAllPositions(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(!m_trade.PositionClose(m_position.Ticket())) // close a position by the specified m_symbol
            if(InpPrintLog)
               Print(__FILE__," ",__FUNCTION__,", ERROR: ","CTrade.PositionClose ",m_position.Ticket());
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void ExpertRemoves(void)
  {
   static int tick_counter=0;
//---
   tick_counter++;
   Comment("\nДо выгрузки эксперта ",__FILE__," осталось ",
           (ticks_to_close-tick_counter)," тиков ");
//--- до
   if(tick_counter>=ticks_to_close)
     {
      ExpertRemove();
      Print(TimeCurrent(),": ",__FUNCTION__," эксперт будет выгружен");
     }
   Print("tick_counter = ",tick_counter);
//---
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void DeleteChart(void)
  {
   long currChart,prevChart=ChartFirst();
   int i=0,limit=100;
   bool errTemplate;
   while(i<limit)
     {
      currChart=ChartNext(prevChart);
      if(TimeFrame!=PERIOD_CURRENT)
        {
         ChartSetSymbolPeriod(prevChart,ChartSymbol(prevChart),TimeFrame);
        }
      errTemplate=ChartApplyTemplate(prevChart,Template+".tpl");
      if(!errTemplate)
        {
         Print("Error ",ChartSymbol(prevChart),"-> ",GetLastError());
        }
      if(currChart<0)
         break;
      Print(i,ChartSymbol(currChart)," ID =",currChart);
      prevChart=currChart;
      i++;
     }
  }
//+------------------------------------------------------------------+
Archivos adjuntos:
 

No, eso es más fiable.


GRACIAS

Razón de la queja: