Comment j'ai assemblé mon conseiller par essais et erreurs - page 18

 

manuellement ou à partir de la ligne de tendance acheter

de l'arrêt de l'indicateur

EURUSDM1

J'ai juste un peu modifié le conseiller expert.

Dossiers :
2.mq5  17 kb
Hand_support.mq5  160 kb
 
Aleksandr Klapatyuk:

manuellement ou à partir de la ligne de tendance acheter

de l'arrêt de l'indicateur

J'ai juste un peu modifié le conseiller expert.

...

j'espère que vous avez obtenu la réponse à votre question sur la configuration de mt4 ... :-)

 
Roman Shiredchenko:

...

j'espère que l'adresse d'installation de mt4 a répondu à votre question... :-)

Oui ! Merci !

 

a un peu changé.

Reverse - inversion d'un signal de trading.

pour l'indicateur a son propre renversement. pour la ligne de tendance à acheter a son propre renversement.

et séparément pour la ligne de tendance pour fermer la position le renversement.

Exemple : dessiner une ligne de tendance de vente - dès que le prix touche la ligne - signal d'achat

GBPUSDM5

sur l'image suivante - la ligne de tendance a déclenché une vente - et a effectué un achat

l'inverse a été déclenché

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
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
Dossiers :
Hand_support.mq5  161 kb
2.mq5  17 kb
 
Tous pour le fonctionnement manuel
Dossiers :
 

il faut faire quelque chose - avec la ligne de tendance sur la clôture

la ligne de tendance n'a pas fonctionné avec l'inverse.

mais le Take Profit a fonctionné sur les pips

EURGBPH2

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

il faut faire quelque chose - avec la ligne de tendance sur la clôture

la ligne de tendance n'a pas fonctionné avec l'inverse.



Je ne sais pas si j'ai bien compris.

mais ce qui est, c'est que ça marche.

Très bien - J'en ai assez de tout le monde.

Pluie de mauvaise humeur.

Dossiers :
Hand_support.mq5  161 kb
 

Ajout d'une autre fonction.

enfermant la position, elle s'ouvrira dans la direction opposée

//+------------------------------------------------------------------+
//| 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;
                 }
              }
           }
  }
//+------------------------------------------------------------------+
Dossiers :
 
Aleksandr Klapatyuk:

Ajout d'une autre fonction.

Lorsque vous fermez une position, elle s'ouvre dans la direction opposée.

Si ça s'ouvre, ça s'ouvre -

Mais sur toutes les paires - qui sont ouvertes.

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

Je l'ai corrigé un peu - pour que l'inversion fonctionne sur chaque paire - séparément.

//+------------------------------------------------------------------+
//| 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;
              }
           }
        }
  }
//+------------------------------------------------------------------+
Dossiers :
 

chalutage à la manière d'un ParabolicSAR à partir de la thermique

//+------------------------------------------------------------------+
//|                                         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();
  }
//+------------------------------------------------------------------+

Je l'ai vérifié - ça marche.

Alpari MT5

Dossiers :
Raison: