Como eu monto meu conselheiro por tentativa e erro - página 49

 

Indicador - Obj LeM Brain - pode ser adaptado ao ExpertUtility Command.mq5

Foto por

para um Indicador você precisa de mais 2 Indicadores - LeMan_BrainTrend1Sig - e - LeManTrend Indicator - sem eles não vai funcionar- Objetos LeM Brain -

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

aumentar a distância das linhas Horizontais, a partir do ponto

Instantâneo2

Arquivos anexados:
 
Alexsandr San:

Precisamos adicionar outra função - quando a linha Horizontal é acionada, que está presente em muitos Indicadores, para excluir não apenas a linha, mas também o próprio Indicador, que desenha a linha Horizontal

 
Alexsandr San:

Outra função a ser adicionada - quando a linha Horizontal é acionada, que está presente em muitos Indicadores, para apagar não apenas a linha, mas também o próprio Indicador que desenha a linha Horizontal

Função adicionada

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"
Arquivos anexados:
 
Alexsandr San:

Indicador - Obj LeM Brain - pode ser adaptado ao ExpertUtility Command.mq5

Você também precisa de mais 2 Indicadores - LeMan_BrainTrend1Sig - e - LeManTrend Indicator - sem eles não vai funcionar- Objetos LeM Brain -

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

aumentar a distância das linhas horizontais, a partir do ponto


Acontece e menos , muda as linhas horizontais para dentro

Foto por

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

Este indicador não precisa ser escrito em um Expert Advisor - apenas Linhas Horizontais são necessárias a partir deste indicador. Deve ser escrito em Expert Advisor para apagar o indicador

você não precisa usá-lo -

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)

e aqui - para apagar o indicador - para que as linhas horizontais do indicador não repitam 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
 

mais uma função a ser adicionada ao Especialista, a partir do sinal para definir o Indicador no Quadro

//+------------------------------------------------------------------+
//|                                         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

Arquivos anexados:
 

Eu não consigo entender o que preciso desta função.

Acho que encontrei uma opção, só preciso escrever no código, ações como na foto

Foto por

 
Alexsandr San:

Eu não consigo entender o que preciso desta função.

Acho que encontrei uma opção, só preciso escrever no código, ações como na foto

Adicionei esta característica ao Comando Utilitário ("Comando Utilitário") # versão de propriedade "1.004".

na parte inferior, configurações para esta função

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

nome da linha de tendência ou linha horizontal - para definir o indicador

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

nome do indicador - qual indicador você deseja instalar no gráfico

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

nome da linha horizontal ou de tendência do Indicador

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


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

Foto por

-------------------------- o princípio de trabalho deve ser

GBPUSDM2

----------------------- O indicador moverá a linha horizontal (azul) - se quebrar, abrirá em VENDA e removerá o indicador e definirá uma linha amarela, que será pega por outro indicador e moverá a linha para o nível roxo do indicador - depois, a linha horizontal amarela, definirá o indicador novamente

GBPUSDM2h

Arquivos anexados:
 
Você o faz por "bitola", você o faz por "bitola" e você negocia.

"Dedo no céu" é o tempo ao vento.
 
Alexsandr San:

Quando eu dreno um depósito, começo a picar.

Portanto, você está perdendo o depósito antes mesmo de começar a negociar.
Daí você "cutucar" do início ao fim.
 
Alexsandr San:

Pensei que você ia dizer algo inteligente.

Coisas inteligentes são ditas quando há uma necessidade imediata.
Agora havia uma necessidade disso. Mas aparentemente não serviu de nada.