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

 

manualmente o de la línea de tendencia comprar

del tope del indicador

EURUSDM1

Acabo de ajustar el Asesor Experto un poco.

Archivos adjuntos:
2.mq5  17 kb
Hand_support.mq5  160 kb
 
Aleksandr Klapatyuk:

manualmente o de la línea de tendencia comprar

del tope del indicador

Acabo de ajustar el Asesor Experto un poco.

...

espero que tengas la respuesta a tu pregunta sobre la configuración de mt4 ... :-)

 
Roman Shiredchenko:

...

espero que tu pregunta haya sido respondida por la dirección de instalación de mt4... :-)

¡Sí! ¡Gracias!

 

ha cambiado un poco.

Reversión - Inversión de una señal comercial.

para el indicador tiene su propia inversión. para la línea de tendencia a la compra tiene su propia inversión.

y por separado para la línea de tendencia para cerrar la posición la inversión.

Ejemplo: dibujar la línea de tendencia de venta - tan pronto como el precio toque la línea - señal de compra

GBPUSDM5

en la siguiente imagen - la línea de tendencia provocó la venta - e hizo una compra

la inversión se activó

input string   t7="------ ТРЕНД ЛИНИЯ ------";        // 
input bool     InpReverse0          = true;          // Reverse Open - переворот торгового сигнала

GBPUSDM5

sinput string  t1="------ Как работать Эксперту---";  //    
input double   InpLots              = 0.01;           // Lots
input bool     InpPanel             = true;           // Скрыть кнопки\\по времени Buy\Sell
input bool     InpOnlyLimit         = false;          // Выставить отложенный ордер 
input bool     InpOnlystart         = true;           // Вкл. Buy\Sell
input bool     InpCloseOpposite     = false;          // Вкл.Trailing Stop по индикатору\Close opposite 
input bool     InpReverse           = false;          // Reverse Indicators - переворот торгового сигнала
input string   t7="------ ТРЕНД ЛИНИЯ ------";        // 
input bool     InpReverse0          = false;          // Reverse Open - переворот торгового сигнала
input string   BuyStop_TrendName    = "buy";          // Trend Line Name "buy";
input string   SellStop_TrendName   = "sell";         // Trend Line Name "sell";
input string   BuyClose_TrendName   = "closesell";    // Trend Line Name "closesell";
input string   SellClose_TrendName  = "closebuy";     // Trend Line Name "closebuy";
input bool     InpReverse1          = false;          // Reverse Close - переворот торгового сигнала
//+------------------------------------------------------------------+
Совершение сделок - Торговые операции - MetaTrader 5
Совершение сделок - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
Archivos adjuntos:
Hand_support.mq5  161 kb
2.mq5  17 kb
 
Todo para el funcionamiento manual
Archivos adjuntos:
 

hay que hacer algo - con la línea de tendencia en el cierre

la línea de tendencia no funcionó con la inversa

pero el Take Profit funcionó en pips

EURGBPH2

Общие принципы - Торговые операции - MetaTrader 5
Общие принципы - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Перед тем как приступить к изучению торговых функций платформы, необходимо создать четкое представление об основных терминах: ордер, сделка и позиция. — это распоряжение брокерской компании купить или продать финансовый инструмент. Различают два основных типа ордеров: рыночный и отложенный. Помимо них существуют специальные ордера Тейк Профит...
 
Aleksandr Klapatyuk:

hay que hacer algo - con la línea de tendencia en el cierre

la línea de tendencia no funcionó con la inversión.



No sé si lo he entendido bien.

pero lo que es, todo funciona.

Muy bien, ya he tenido suficiente de todos.

Mal humor por la lluvia.

Archivos adjuntos:
Hand_support.mq5  161 kb
 

Se ha añadido otra función.

alcerrar la posición se abrirá en sentido contrario

//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction &Trans,const MqlTradeRequest &Request_,const MqlTradeResult &Result_)
  {
//--- get transaction type as enumeration value
   ENUM_TRADE_TRANSACTION_TYPE type=Trans.type;
//--- if transaction is result of addition of the transaction in history
   static bool Flag=true;
   if(Flag)
      if(inpbuysell)
         if(type==TRADE_TRANSACTION_DEAL_ADD)
           {
            long     deal_type         =-1;
            long     deal_entry        =-1;
            double   deal_volume       =0.0;
            string   deal_symbol       =NULL;
            if(HistoryDealSelect(Trans.deal))
              {
               deal_type         =HistoryDealGetInteger(Trans.deal,DEAL_TYPE);
               deal_entry        =HistoryDealGetInteger(Trans.deal,DEAL_ENTRY);
               deal_volume       =HistoryDealGetDouble(Trans.deal,DEAL_VOLUME);
               deal_symbol       =HistoryDealGetString(Trans.deal,DEAL_SYMBOL);
              }
            else
               return;
            if(deal_entry==DEAL_ENTRY_OUT)
              {
               switch((int)deal_type)
                 {
                  case  DEAL_TYPE_BUY:
                     ExtTrade.Buy(deal_volume,deal_symbol);
                     break;
                  case  DEAL_TYPE_SELL:
                     ExtTrade.Sell(deal_volume,deal_symbol);
                     break;
                  default:
                     break;
                     Flag=false;
                 }
              }
           }
  }
//+------------------------------------------------------------------+
Archivos adjuntos:
 
Aleksandr Klapatyuk:

Se ha añadido otra función.

Cuando se cierra una posición, se abre en sentido contrario

Si se abre, se abre -

Pero en todos los pares - que están abiertos.

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

Lo he corregido un poco - para que la inversión funcione en cada par - por separado

//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction &Trans,const MqlTradeRequest &Request_,const MqlTradeResult &Result_)
  {
//--- if transaction is result of addition of the transaction in history
   static bool Flag=true;
//--- get transaction type as enumeration value
   ENUM_TRADE_TRANSACTION_TYPE type=Trans.type;
   if(Flag && inpbuysell)
      if(type==TRADE_TRANSACTION_DEAL_ADD)
        {
         long     deal_type         =-1;
         long     deal_entry        =-1;
         double   deal_volume       =0.0;
         string   deal_symbol       =deal_symb;
         if(HistoryDealSelect(Trans.deal))
           {
            deal_type         =HistoryDealGetInteger(Trans.deal,DEAL_TYPE);
            deal_entry        =HistoryDealGetInteger(Trans.deal,DEAL_ENTRY);
            deal_volume       =HistoryDealGetDouble(Trans.deal,DEAL_VOLUME);
            deal_symbol       =HistoryDealGetString(Trans.deal,DEAL_SYMBOL);
           }
         else
            return;
         if(deal_entry==DEAL_ENTRY_OUT && deal_symbol==deal_symb)
           {
            switch((int)deal_type)
              {
               case  DEAL_TYPE_BUY:
                  ExtTrade.Buy(deal_volume,deal_symbol);
                  break;
               case  DEAL_TYPE_SELL:
                  ExtTrade.Sell(deal_volume,deal_symbol);
                  break;
               default:
                  break;
                  Flag=false;
              }
           }
        }
  }
//+------------------------------------------------------------------+
Archivos adjuntos:
 

de forma ParabolicSAR desde el punto de vista térmico

//+------------------------------------------------------------------+
//|                                         TrailingParabolicSAR.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
#include <Expert\Trailing\TrailingParabolicSAR.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for trailing
input double Trailing_ParabolicSAR_Step   =0.02;  // Speed increment
input double Trailing_ParabolicSAR_Maximum=0.2;   // Maximum rate
//---
bool         Expert_EveryTick=false;
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
   if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,0))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing expert");
      ExtExpert.Deinit();
      return(-1);
     }
//--- Creation of trailing object
   CTrailingPSAR *trailing=new CTrailingPSAR;
   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
   trailing.Step(Trailing_ParabolicSAR_Step);
   trailing.Maximum(Trailing_ParabolicSAR_Maximum);
//--- 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();
  }
//+------------------------------------------------------------------+

Lo he comprobado - funciona.

Alpari MT5

Archivos adjuntos:
Razón de la queja: