Debate sobre la implantación de los consejeros. - página 5

 
Ivan_Invanov:
Aquí he aprendido la sintaxis del idioma. Estoy aprendiendo el constructor como ejemplo. Veo una llamada de clase. A partir de aquí se me corta la lógica. ¿Qué debo hacer? ¿Búsqueda de artículos? ¿Es mejor implementar con medios estándar o escribir mis propias clases?
Encuentro un artículo sobre la aclaración del constructor. Explicar cómo funciona un bloque de señales, por ejemplo. Y un par de frases secas como sí, este parámetro es fijo. Y no hay nada escrito para cambiarlo. Tengo estas preguntas, si no necesito el parámetro, puedo simplemente borrarlo? está en la inicialización, ¿borrarlo ahí también? ¿Cómo puedo añadir más parámetros y cómo? Si viera un ejemplo de cambio, podría entenderlo. Creo que es un problema puramente de referencia. No hay suficientes detalles, ni ejemplos, ni generalizaciones para una percepción sistemática. Tal vez sea muy brusco, no lo sé. Me pregunto si sólo soy yo. ¿O quizá haya que mejorar los manuales de formación? Estoy dispuesto a pagar personalmente dinero por ejemplo.
 
Ivan_Invanov:

MQL5 - Este es el recurso con la descripción más detallada de la documentación. Hay una gran cantidad de información en los artículos, el foro y KodoBase. En ningún otro lugar del mundo encontrará una descripción tan detallada.

Todo lo que necesitas es la voluntad de entenderlo todo.

 
Vladimir Karputov:

MQL5 - Este es el recurso con la descripción más detallada de la documentación. Hay una gran cantidad de información en los artículos, el foro y KodoBase. En ningún otro lugar del mundo encontrará una descripción tan detallada.

Sólo se necesita la voluntad de captarlo todo.

He aquí una pregunta concreta. Tenemos CExpertSignal con la función AddFilter. Por ejemplo, tenemos una extensión allí. Cómo lo hago si no puedo ver el ejemplo. ¿Qué debo hacer exactamente? Bueno, intentaré adivinarlo ahora.

CExpert ExtExpert;
ExtExpert.InitSignal(signal);
signal.AddFilter(filter0);
filer0.Spread(20);

Compilación sin errores. ¿Lo he escrito correctamente? ¿Ahora las operaciones no se concluirán si el diferencial supera los 20? ¿Y qué debo hacer en ese caso? ¿Qué puede leer?

 
Ivan_Invanov:

He aquí una pregunta concreta. Hay una CExpertSignal con AddFilter en ella, pero la ayuda no dice nada sobre las funciones de AddFilter. Por ejemplo, hay un diferencial. Cómo lo hago si no puedo ver el ejemplo. ¿Qué debo hacer exactamente? Bueno, intentaré adivinarlo ahora.

Compilación sin errores. ¿Lo he escrito correctamente? ¿Ahora las operaciones no se concluirán si el diferencial supera los 20? ¿Y qué debo hacer en ese caso? ¿Qué debo leer?

Leer:Asistente MQL4/MQL5

Asignación:

  • Para crear un Asesor Experto simple utilizando el Asistente
  • en el MetaEditor abra el código resultante
Después de eso, haz preguntas.
Мастер MQL4/MQL5 - Справка по MetaEditor
Мастер MQL4/MQL5 - Справка по MetaEditor
  • www.metatrader5.com
Благодаря Мастеру MQL4/MQL5, трейдер может создать советника, не обладая знаниями в области программирования. Все что нужно сделать — это выбрать торговые сигналы, которые будет использовать советник, алгоритм мани-менеджмента и трейлинг-стопа. Код советника будет сгенерирован автоматически на основе выбранных параметров. Помимо этого, Мастер...
 
Ivan_Invanov:

He aquí una pregunta concreta. Hay una CExpertSignal con AddFilter en ella, pero la ayuda no dice nada sobre las funciones de AddFilter. Por ejemplo, hay un diferencial. Cómo lo escribo, si no puedo ver el ejemplo. ¿Qué debo hacer exactamente? Bueno, intentaré adivinarlo ahora.

Compilación sin errores. ¿Lo he escrito correctamente? ¿Ahora las operaciones no se concluirán si el diferencial supera los 20? ¿Y qué debo hacer en ese caso? ¿Qué debo leer?

Me parece que aquí hay un intento de empezar inmediatamente a escribir temas de adultos sin conocimientos básicos. No es así como funciona. Primero aprenden el alfabeto, luego aprenden a escribir en letra de molde y poco a poco llegan a la redacción, y luego se necesita talento. Así que es lo mismo sin conocimientos básicos tratar de entender el código generado automáticamente... No es la mejor manera de golpearse la cabeza contra la pared.

 
//+------------------------------------------------------------------+
//|                                                            1.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"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
//--- available signals
#include <Expert\Signal\SignalMA.mqh>
//--- available trailing
#include <Expert\Trailing\TrailingNone.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedRisk.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string             Expert_Title         ="1";         // Document name
ulong                    Expert_MagicNumber   =15825;       //
bool                     Expert_EveryTick     =false;       //
//--- inputs for main signal
input int                Signal_ThresholdOpen =10;          // Signal threshold value to open [0...100]
input int                Signal_ThresholdClose=10;          // Signal threshold value to close [0...100]
input double             Signal_PriceLevel    =0.0;         // Price level to execute a deal
input double             Signal_StopLevel     =50.0;        // Stop Loss level (in points)
input double             Signal_TakeLevel     =50.0;        // Take Profit level (in points)
input int                Signal_Expiration    =4;           // Expiration of pending orders (in bars)
input int                Signal_MA_PeriodMA   =12;          // Moving Average(12,0,...) Period of averaging
input int                Signal_MA_Shift      =0;           // Moving Average(12,0,...) Time shift
input ENUM_MA_METHOD     Signal_MA_Method     =MODE_SMA;    // Moving Average(12,0,...) Method of averaging
input ENUM_APPLIED_PRICE Signal_MA_Applied    =PRICE_CLOSE; // Moving Average(12,0,...) Prices series
input double             Signal_MA_Weight     =1.0;         // Moving Average(12,0,...) Weight [0...1.0]
//--- inputs for money
input double             Money_FixRisk_Percent=10.0;        // Risk percentage
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
   if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing expert");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Creating signal
   CExpertSignal *signal=new CExpertSignal;
   if(signal==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating signal");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//---
   ExtExpert.InitSignal(signal);
   signal.ThresholdOpen(Signal_ThresholdOpen);
   signal.ThresholdClose(Signal_ThresholdClose);
   signal.PriceLevel(Signal_PriceLevel);
   signal.StopLevel(Signal_StopLevel);
   signal.TakeLevel(Signal_TakeLevel);
   signal.Expiration(Signal_Expiration);
//--- Creating filter CSignalMA
   CSignalMA *filter0=new CSignalMA;
   if(filter0==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating filter0");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
   signal.AddFilter(filter0);
//--- Set filter parameters
   filter0.PeriodMA(Signal_MA_PeriodMA);
   filter0.Shift(Signal_MA_Shift);
   filter0.Method(Signal_MA_Method);
   filter0.Applied(Signal_MA_Applied);
   filter0.Weight(Signal_MA_Weight);
//--- Creation of trailing object
   CTrailingNone *trailing=new CTrailingNone;
   if(trailing==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating trailing");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Add trailing to expert (will be deleted automatically))
   if(!ExtExpert.InitTrailing(trailing))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing trailing");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Set trailing parameters
//--- Creation of money object
   CMoneyFixedRisk *money=new CMoneyFixedRisk;
   if(money==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating money");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Add money to expert (will be deleted automatically))
   if(!ExtExpert.InitMoney(money))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing money");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Set money parameters
   money.Percent(Money_FixRisk_Percent);
//--- Check all trading objects parameters
   if(!ExtExpert.ValidationSettings())
     {
      //--- failed
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Tuning of all necessary indicators
   if(!ExtExpert.InitIndicators())
     {
      //--- failed
      printf(__FUNCTION__+": error initializing indicators");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- ok
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ExtExpert.Deinit();
  }
//+------------------------------------------------------------------+
//| "Tick" event handler function                                    |
//+------------------------------------------------------------------+
void OnTick()
  {
   ExtExpert.OnTick();
  }
//+------------------------------------------------------------------+
//| "Trade" event handler function                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
   ExtExpert.OnTrade();
  }
//+------------------------------------------------------------------+
//| "Timer" event handler function                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   ExtExpert.OnTimer();
  }
//+------------------------------------------------------------------+
Hola. ¿Podría decirme qué señal de entrada al mercado tiene este EA y dónde se encuentra en el código?
Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
La señal de entrada al mercado está en el "filtro", ¿verdad?
 
¿Por qué diferentes declaraciones de clase? ¿Por qué unas veces se apila la memoria y otras no? ¿Con y sin asterisco?
 
Necesito un filtro de propagación y me gustaría entender lo que se está haciendo aquí. ¿He entendido bien que la estrategia aquí es que si el precio es más alto por cualquier cifra de la media, entonces se hace una operación?
 
Ivan_Invanov:
Hola. ¿Puede decirme, por favor, cuál es la señal de entrada al mercado de este EA y dónde se encuentra en el código?

Hay que utilizar un depurador para tratar estos temas.

Cuando llega un tick, se llama a la función OnTick(). Es donde tiene lugar todo el procesamiento, se identifican las señales si es necesario y se realizan las acciones de negociación.

Como puedes ver, en esta función el ExtExpert. Todo ocurre dentro de esta función, no hay nada más en el código.

En consecuencia, se pone un punto de interrupción en él y se ejecuta el Asesor Experto en el depurador. En cuanto llega el primer tick, se dispara el punto de ruptura y se detiene el código en esta posición. Y luego te mueves por el código paso a paso, averiguando por qué y qué acciones se realizan.

Razón de la queja: