Scriverò un EA gratuitamente - pagina 112

 
Buona salute a tutti! A giudicare dal feedback sul forum sulla mia domanda se è possibile fare un gufo basato su linee colorate dai soliti indicatori presenti nel grafico, è diventato chiaro dal feedback - è possibile. Cioè, per esempio, il verde incrocia il blu, il blu incrocia il rosso, ecc. E quando queste condizioni coincidono, viene piazzato un ordine nella direzione appropriata. Perché proprio per le linee? Perché un tale Expert Advisor sarebbe un grande aiutoper un trader principiante che sperimenta molto e verifica numerose teorie, e un Expert Advisor davvero prezioso per risparmiare tempo e nervi. Perché il mio messaggio è qui, nella sezione EAs gratuiti? Perché sarà sicuramente utile, se non a tutti, a molte persone. Allego uno screenshot per capire meglio di cosa sto parlando.
File:
o9b4dq-1.jpg  73 kb
 
Salve. C'è un modo per automatizzare la strategia Forex Academy SniperX?
 
Ciao a tutti, potreste suggerire qualcosa di simile a questo --e-CloseByProfit- EA chiuderà tutte le posizioni quando raggiungono un livello di profitto o perdita totale predefinito --- solo su MT5. Grazie.
 

Salve. Potresti aiutarmi, se hai tempo La domanda è questa, ho bisogno che l'EA apra un ordine su ogni segnale di due indicatori, (danno un segnale quando sono in certa combinazione) in una parola, ci dovrebbero essere diversi ordini per comprare o vendere nel mercato, di conseguenza, secondo i segnali degli indicatori. Ma ho solo un ordine nel mercato e finché non si chiude quello successivo non si apre...... È una questione di conteggio degli ordini? Per favore, datemi un suggerimento. Posso inviarvi il codice se ne avete bisogno.

Molte grazie in anticipo!

 
danil77783:

Salve. Potresti aiutarmi, se hai tempo La domanda è questa, ho bisogno che l'EA apra un ordine su ogni segnale di due indicatori, (danno un segnale quando sono in certa combinazione) in una parola, ci dovrebbero essere diversi ordini di acquisto o vendita nel mercato, rispettivamente, secondo i segnali degli indicatori. Ma ho solo un ordine nel mercato e finché non si chiude quello successivo non si apre ...... È una questione di conteggio degli ordini? Per favore, datemi un suggerimento. Se ne avete bisogno, posso mandarvi il codice.

Grazie in anticipo!

Beh, non puoi riparare il tuo EA senza il codice, a meno che tu non cominci a capire la programmazione. Molto probabilmente, il tuo EA è scritto sul modello con 1 ordine nel mercato ed è in realtà molto difficile da correggere, perché trattare con più ordini e con criteri diversi è molto diverso.

 
Pawel Egoshin:
Quello di cui hai bisogno è un EA, un martin normale con un aumento del passo.

Non c'è una sola opzione per Ilan? In generale, ci sono un sacco di questi piombini proprio nell'open source, ma probabilmente bisogna essere presentati su un piatto d'argento...

 
Sergey Martynov:

Naturalmente è passato molto tempo, ma una rapida occhiata al codice dice che devo scrivere di nuovo il bot, basato sulla strategia - perché non ha senso così tante chiamate all'indicatore, perché già nella chiamata viene dato il risultato del successivo confronto, a meno che non sia calcolato per uno strumento con 4 cifre PRIMA del punto decimale...

 
yuriy kovalchuk:
Ciao, puoi suggerire qualcosa di simile a questo --e-CloseByProfit- EA chiuderà tutte le posizioni quando raggiunge un profitto o una perdita totale predefinita --- solo su MT5. Grazie.

Qualcosa del genere. Devi solo inserire il tuo saldo + quello che vuoi guadagnare

//+------------------------------------------------------------------+
//|                                                  CloseEquity.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"

//+------------------------------------------------------------------+
//|                                          Close all if a loss.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//|                     https://www.mql5.com/ru/market/product/43516 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property link      "https://www.mql5.com/ru/market/product/43516"
#property version   "1.000"
/*
   barabashkakvn Trading engine 3.112
*/
#include <Trade\Trade.mqh>
#include <Trade\AccountInfo.mqh>
//---
CPositionInfo  m_position;                   // object of CPositionInfo class
CTrade         m_trade;                      // object of CTrade class
CAccountInfo   m_account;                    // object of CAccountInfo class
//--- input parameters
input double   InpProfit            = 150000;      // Profit Equity, in money
input bool     InpPrintLog          = false;       // Print log
input ulong    InpMagic             = 42967428;    // Magic number
//---
bool     m_stop                     = false;
int      ticks_to_close             = 1;           // количество тиков до снятия эксперта
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   m_trade.SetExpertMagicNumber(InpMagic);
   m_trade.SetMarginMode();
   m_trade.SetTypeFillingBySymbol(Symbol());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(AccountInfoDouble(ACCOUNT_EQUITY)>InpProfit)
     {
      if(IsPositionExists())
        {
         CloseAllPositions();
         return;
        }
      else
        {
         Alert("It is necessary to restart the adviser");
         ExpertRemoves();
         m_stop=true;
        }
     }
   if(m_stop)
      return;
//---
  }
//+------------------------------------------------------------------+
//| Is position exists                                               |
//+------------------------------------------------------------------+
bool IsPositionExists(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--)
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         return(true);
//---
   return(false);
  }
//+------------------------------------------------------------------+
//| Close all positions                                              |
//+------------------------------------------------------------------+
void CloseAllPositions(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(!m_trade.PositionClose(m_position.Ticket())) // close a position by the specified m_symbol
            if(InpPrintLog)
               Print(__FILE__," ",__FUNCTION__,", ERROR: ","CTrade.PositionClose ",m_position.Ticket());
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void ExpertRemoves(void)
  {
   static int tick_counter=0;
//---
   tick_counter++;
   Comment("\nДо выгрузки эксперта ",__FILE__," осталось ",
           (ticks_to_close-tick_counter)," тиков ");
//--- до
   if(tick_counter>=ticks_to_close)
     {
      ExpertRemove();
      Print(TimeCurrent(),": ",__FUNCTION__," эксперт будет выгружен");
     }
   Print("tick_counter = ",tick_counter);
//---
  }
//+------------------------------------------------------------------+
File:
CloseEquity.mq5  10 kb
 
Alexsandr San:

Qualcosa del genere. Devi solo mettere il tuo bilancio + quello che vuoi fare.


No, questo è più affidabile.

//+------------------------------------------------------------------+
//|                                                  CloseEquity.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"

//+------------------------------------------------------------------+
//|                                          Close all if a loss.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//|                     https://www.mql5.com/ru/market/product/43516 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property link      "https://www.mql5.com/ru/market/product/43516"
#property version   "1.000"
/*
   barabashkakvn Trading engine 3.112
*/
#include <Trade\Trade.mqh>
#include <Trade\AccountInfo.mqh>
//---
CPositionInfo  m_position;                   // object of CPositionInfo class
CTrade         m_trade;                      // object of CTrade class
CAccountInfo   m_account;                    // object of CAccountInfo class
//--- input parameters
input string   Template             = "ADX";       // Имя шаблона(without '.tpl')
input double   InpProfit            = 150000;      // Profit Equity, in money
input bool     InpPrintLog          = false;       // Print log
input ulong    InpMagic             = 42967428;    // Magic number
//---
bool     m_stop                     = false;
int      ticks_to_close             = 1;           // количество тиков до снятия эксперта
uint     SLEEPTIME                  = 1;           // Время паузы между повторами в секундах
ENUM_TIMEFRAMES TimeFrame;                         // Change TimeFrame - Current = dont changed
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   m_trade.SetExpertMagicNumber(InpMagic);
   m_trade.SetMarginMode();
   m_trade.SetTypeFillingBySymbol(Symbol());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(AccountInfoDouble(ACCOUNT_EQUITY)>InpProfit)
     {
      if(IsPositionExists())
        {
         CloseAllPositions();
         Sleep(SLEEPTIME*1000);
         CloseAllPositions();
         return;
        }
      else
        {
         Alert("It is necessary to restart the adviser");
         ExpertRemoves();
         DeleteChart();
         m_stop=true;
        }
     }
   if(m_stop)
      return;
//---
  }
//+------------------------------------------------------------------+
//| Is position exists                                               |
//+------------------------------------------------------------------+
bool IsPositionExists(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--)
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         return(true);
//---
   return(false);
  }
//+------------------------------------------------------------------+
//| Close all positions                                              |
//+------------------------------------------------------------------+
void CloseAllPositions(void)
  {
   for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(!m_trade.PositionClose(m_position.Ticket())) // close a position by the specified m_symbol
            if(InpPrintLog)
               Print(__FILE__," ",__FUNCTION__,", ERROR: ","CTrade.PositionClose ",m_position.Ticket());
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void ExpertRemoves(void)
  {
   static int tick_counter=0;
//---
   tick_counter++;
   Comment("\nДо выгрузки эксперта ",__FILE__," осталось ",
           (ticks_to_close-tick_counter)," тиков ");
//--- до
   if(tick_counter>=ticks_to_close)
     {
      ExpertRemove();
      Print(TimeCurrent(),": ",__FUNCTION__," эксперт будет выгружен");
     }
   Print("tick_counter = ",tick_counter);
//---
  }
//+------------------------------------------------------------------+
//| start function                                                   |
//+------------------------------------------------------------------+
void DeleteChart(void)
  {
   long currChart,prevChart=ChartFirst();
   int i=0,limit=100;
   bool errTemplate;
   while(i<limit)
     {
      currChart=ChartNext(prevChart);
      if(TimeFrame!=PERIOD_CURRENT)
        {
         ChartSetSymbolPeriod(prevChart,ChartSymbol(prevChart),TimeFrame);
        }
      errTemplate=ChartApplyTemplate(prevChart,Template+".tpl");
      if(!errTemplate)
        {
         Print("Error ",ChartSymbol(prevChart),"-> ",GetLastError());
        }
      if(currChart<0)
         break;
      Print(i,ChartSymbol(currChart)," ID =",currChart);
      prevChart=currChart;
      i++;
     }
  }
//+------------------------------------------------------------------+
File:
 

No, questo è più affidabile.


GRAZIE

Motivazione: