Cómo armo mi asesor por ensayo y error - página 49

 

Indicador - Obj LeM Brain - se puede adaptar a ExpertUtility Command.mq5

Foto de

Usted también necesita 2 más Indicadores - LeMan_BrainTrend1Sig - y - LeManTrend Indicador - sin ellos no va a funcionar- Obj LeM Brain -

-----------------------------------------------------------

aumentar la distancia de las líneas horizontales, desde el punto

Instantánea2

Archivos adjuntos:
 
Alexsandr San:

Tenemos que añadir otra función - cuando se dispara la línea Horizon tal, que está presente en muchos Indicadores, para eliminar no sólo la línea sino también el propio Indicador, que dibuja la línea Horizontal

 
Alexsandr San:

Otra función a añadir - cuando se dispara la línea Horizon tal, que está presente en muchos Indicadores, para borrar no sólo la línea sino también el propio Indicador que dibuja la línea Horizontal

Función añadida

input string   t8="------ Indicator Delete ------";              //
input string   Inpshort_name                = "Obj LeM Brain";   // INDICATOR_SHORTNAME 1
input string   Inpshort_name0               = "Indicator 2";     // INDICATOR_SHORTNAME 2
input bool     Inpres                       = false;             // Delete All Indicators
//---
#property version     "1.002"
Archivos adjuntos:
 
Alexsandr San:

Indicador - Obj LeM Brain - se puede adaptar a ExpertUtility Command.mq5

para un indicador que necesita 2 más Indicadores - LeMan_BrainTrend1Sig - y - LeManTrend Indicador - sin ellos no funcionará- Objeto LeM Brain -

-----------------------------------------------------------

aumentar la distancia de las líneas horizontales, desde el punto


Gira hacia fuera y hacia abajo , cambia las líneas horizontales hacia dentro

Foto de

---------------------------------------------------------

Este indicador no necesita ser escrito en un Asesor Experto - sólo se necesitan las Líneas Horizontales de este indicador. Se debe escribir en el Asesor Experto para eliminar el indicador

no tienes que usarlo -

input string   t2="----- Indicators: SELL   -----";              //
input string   short_name                   = "LeMan_BrainTrend1Sig";   // Name Indicators "SELL"
input bool     InpIndicators                = false;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY   = open_sell;         // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU   = close_sells;       // Trade command: (SellBuffer Indicators)
input string   t3="----- Indicators: BUY    -----";              //
input string   short_name1                  = "LeMan_BrainTrend1Sig";   // Name Indicators "BUY"
input bool     InpIndicators1               = false;             // Indicators: Start (true)
input ENUM_TRADE_COMMAND InpTradeCommandY1  = close_buys;        // Trade command: (BuyBuffer Indicators)
input ENUM_TRADE_COMMAND InpTradeCommandU1  = open_buy;          // Trade command: (SellBuffer Indicators)

y aquí - para borrar el indicador - para que las líneas horizontales del indicador no repitan los comandos

input string   t8="------ Indicator Delete ------";              //
input string   Inpshort_name                = "Obj LeM Brain";   // INDICATOR_SHORTNAME 1
input string   Inpshort_name0               = "Indicator 2";     // INDICATOR_SHORTNAME 2
input bool     Inpres                       = false;             // Delete All Indicators
 

una función más a añadir al Experto, desde la señal para fijar el Indicador en el Gráfico

//+------------------------------------------------------------------+
//|                                         AddChartIndicatorAdd.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"
#property script_show_inputs
//---
input string Inpshort_name  = "Obj LeM Brain"; // INDICATOR_SHORTNAME
input string Inpshort_name0 = "Examples/MACD"; // INDICATOR_SHORTNAME
//---
int indicator_handle=INVALID_HANDLE;
int indicator_handle0=INVALID_HANDLE;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   AddIndicator();
   AddIndicator0();
  }
//+------------------------------------------------------------------+
//| Функция проверки и добавления индикатора на график               |
//+------------------------------------------------------------------+
bool AddIndicator()
  {
//--- выводимое сообщение
   string message;
//--- проверим на совпадение символ индикатора и символ графика
   if(_Symbol!=_Symbol)
     {
      message="Демонстрация использования функции Demo_ChartIndicatorAdd():";
      message=message+"\r\n";
      message=message+"Нельзя на график добавить индикатор, рассчитанный на другом символе.";
      message=message+"\r\n";
      message=message+"Укажите в свойствах эксперта символ графика - "+_Symbol+".";
      Alert(message);
      //--- досрочный выход, не будем добавлять индикатор на график
      return false;
     }
//--- проверим на совпадение таймфрейм индикатора и таймфрейм графика
   if(_Period!=_Period)
     {
      message="Нельзя на график добавить индикатор, рассчитанный на другом таймфрейме.";
      message=message+"\r\n";
      message=message+"Укажите в свойствах эксперта таймфрейм графика - "+EnumToString(_Period)+".";
      Alert(message);
      //--- досрочный выход, не будем добавлять индикатор на график
      return false;
     }
//--- все проверки прошли, символ и период индикатора соответствуют графику
   if(indicator_handle==INVALID_HANDLE)
     {
      Print(__FUNCTION__,"  Создаем индикатор MACD");
      indicator_handle=iCustom(_Symbol,_Period,Inpshort_name);
      if(indicator_handle==INVALID_HANDLE)
        {
         Print("Не удалось создать индикатор MACD. Код ошибки ",GetLastError());
        }
     }
//--- сбросим код ошибки
   ResetLastError();
//--- накладываем индикатор на график
   Print(__FUNCTION__,"  Добавляем индикатор MACD на график");
   Print("MACD построен на ",_Symbol,"/",EnumToString(_Period));
//--- получим номер нового подокна, в которое добавим индикатор MACD
   int subwindow=(int)ChartGetInteger(0,0);
   PrintFormat("Добавляем индикатор MACD на окно %d графика",subwindow);
   if(!ChartIndicatorAdd(0,subwindow,indicator_handle))
     {
      PrintFormat("Не удалось добавить индикатор MACD на окно %d графика. Код ошибки  %d",
                  subwindow,GetLastError());
     }
//--- добавление индикатора на график прошло успешно
   return(true);
  }
//+------------------------------------------------------------------+
//| Функция проверки и добавления индикатора на график               |
//+------------------------------------------------------------------+
bool AddIndicator0()
  {
//--- выводимое сообщение
   string message;
//--- проверим на совпадение символ индикатора и символ графика
   if(_Symbol!=_Symbol)
     {
      message="Демонстрация использования функции Demo_ChartIndicatorAdd():";
      message=message+"\r\n";
      message=message+"Нельзя на график добавить индикатор, рассчитанный на другом символе.";
      message=message+"\r\n";
      message=message+"Укажите в свойствах эксперта символ графика - "+_Symbol+".";
      Alert(message);
      //--- досрочный выход, не будем добавлять индикатор на график
      return false;
     }
//--- проверим на совпадение таймфрейм индикатора и таймфрейм графика
   if(_Period!=_Period)
     {
      message="Нельзя на график добавить индикатор, рассчитанный на другом таймфрейме.";
      message=message+"\r\n";
      message=message+"Укажите в свойствах эксперта таймфрейм графика - "+EnumToString(_Period)+".";
      Alert(message);
      //--- досрочный выход, не будем добавлять индикатор на график
      return false;
     }
//--- все проверки прошли, символ и период индикатора соответствуют графику
   if(indicator_handle0==INVALID_HANDLE)
     {
      Print(__FUNCTION__,"  Создаем индикатор MACD");
      indicator_handle0=iCustom(_Symbol,_Period,Inpshort_name0);
      if(indicator_handle0==INVALID_HANDLE)
        {
         Print("Не удалось создать индикатор MACD. Код ошибки ",GetLastError());
        }
     }
//--- сбросим код ошибки
   ResetLastError();
//--- накладываем индикатор на график
   Print(__FUNCTION__,"  Добавляем индикатор MACD на график");
   Print("MACD построен на ",_Symbol,"/",EnumToString(_Period));
//--- получим номер нового подокна, в которое добавим индикатор MACD
   int subwindow=(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL);
   PrintFormat("Добавляем индикатор MACD на окно %d графика",subwindow);
   if(!ChartIndicatorAdd(0,subwindow,indicator_handle0))
     {
      PrintFormat("Не удалось добавить индикатор MACD на окно %d графика. Код ошибки  %d",
                  subwindow,GetLastError());
     }
//--- добавление индикатора на график прошло успешно
   return(true);
  }
//+------------------------------------------------------------------+

Tiro4

Archivos adjuntos:
 

No consigo saber qué necesito de esta función.

Creo que he encontrado una opción, sólo tengo que escribir en el código, tales acciones, como en la imagen

Foto de

 
Alexsandr San:

No consigo saber qué necesito de esta función.

Creo que he encontrado una opción, sólo tengo que escribir en el código, tales acciones, como en la imagen

He añadido esta función al comando de utilidad ("Utility Command") #property version "1.004"

en la parte inferior, los ajustes para esta función

input string   t1="----- Trailing Line: 2   -----";              //
input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)
input int      InpStep3                     = 0;                 // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InpTradeCommandG   = close_open_b;      // Obj:  command:
input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)
input int      InpStep4                     = 0;                 // Obj: Шаг сетки, пунктов("0" -> false)
input ENUM_TRADE_COMMAND InTradeCommandG    = close_open_s;      // Obj:  command:
input ushort   InpObjTrailingStopG          = 0;                 // Obj: Trailing Stop (distance from price to object, in pips)
input ushort   InpObjTrailingStepG          = 5;                 // Obj: Trailing Step, in pips (1.00045-1.00055=1 pips)
input string   t9="------ ChartIndicatorAdd -----";              //
input bool     InpChartInd                  = false;             // Avto Line Chart Indicators
input string   InpIndiL                     = "AVERAGE 0";       // Line name (ChartIndicatorAdd)
input int      InpStep5                     = 15;                // Obj: Шаг сетки, пунктов("0" -> false)
input string   InpIndi_name                 = "Obj LeM Brain";   // INDICATOR_SHORTNAME

nombre de la línea de tendencia o de la línea horizontal - para fijar el indicador

input string   InpIndiL                     = "AVERAGE 0";       // Line name (ChartIndicatorAdd)

nombre del indicador - qué indicador quiere instalar en el gráfico

input string   InpIndi_name                 = "Obj LeM Brain";   // INDICATOR_SHORTNAME

nombre de la línea horizontal o de tendencia del Indicador

input string   InpObjUpNameG                = "POT";             // Obj: TOP (Horizontal Line)


input string   InpObjDownNameG              = "REWOL";           // Obj: LOWER (Horizontal Line)

Foto de

-------------------------- el principio de funcionamiento debe ser

GBPUSDM2

----------------------- El indicador moverá la línea horizontal (azul) - si se rompe a través de, se abrirá en SELL y eliminar el indicador y establecer una línea amarilla, que será recogido por otro indicador y mover la línea hasta el nivel de púrpura del indicador - después de, la línea amarilla horizontal, establecerá el indicador de nuevo

GBPUSDM2h

Archivos adjuntos:
 
Lo haces por "calibre" y lo haces por "calibre".

"El dedo en el cielo" es el tiempo en el viento.
 
Alexsandr San:

Cuando dreno un depósito, empiezo a pinchar.

Así que usted está perdiendo el depósito incluso antes de empezar a operar.
De ahí que se "pinche" desde el principio hasta el final.
 
Alexsandr San:

Pensé que ibas a decir algo inteligente.

Las cosas inteligentes se dicen cuando hay una necesidad inmediata.
Ahora era necesario. Pero aparentemente no sirvió de nada.
Razón de la queja: