I will write an advisor free of charge - page 120

 
Hello ! Can someone tweak the advisor ?
 
Hello. Please help me write an EA. It's really good. I'm sorry I can't post my idea publicly. If you can help, please send me a private message. I would be very grateful!
 
kasdamato222:
Hello. Please help me write an EA. It's really good. I'm sorry, but I can't post my idea publicly. I'd be very grateful if you could help me out by sending a private message.

If it's a very good idea, pay a programmer to put your idea into an Expert.

 
Hello, can you advise who could help hook the ASK indicator to auto trading using MT2auto trading. The indicator gives a signal, draws an arrow and gives an alert, but when I install MT2 on the chart it does not see it and therefore does not copy the signals. i think i need to correct something in the ASK indicator settings or change the arrow format. i am ready to thank for qualified help. Thank you.
Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Среди программ для автоматического трейдинга можно выделить две большие категории: торговые роботы и индикаторы. Первые предназначены для совершения торговых операций на рынках, а вторые — для анализа котировок и выявления закономерностей в их изменении. При этом индикаторы могут использоваться непосредственно в роботах, образуя полноценную...
 
I need a simple EA on mql5. At the beginning of its work, 2 buy/sell buttons should appear, pressing one of them should open a trade with parameters that are predefined and a magic number. Once the button is pressed, it should disappear until the moment when there are no open positions on the given chart. If this time has come, the buttons should appear.
Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Sysmart:
I need a simple EA on mql5. At the beginning of its work, there should be 2 buy/sell buttons, pressing one of them should open a deal with pre-defined parameters and a magic number. Once the button is pressed, it should disappear until the moment when there are no open positions on the given chart. If this time has come, the buttons should appear.

I made a panel of two buttons:Open Close Panel

Open Close Panel

andOpen Close Panel 2

Open Close Panel 2


Except that the buttons wouldn't disappear or lock.

Open Close Panel
Open Close Panel
  • www.mql5.com
Сама панель содержит три кнопки: 'BUY', 'SELL' и 'CLOSE'. Рассчитана на ручную торговлю - быстро открывать позиции с заданным уровнем Стоп лосс и Тейк профит, а также для быстрого закрытия всех позиций. Архив "Open Close Panel.zip" необходимо распаковать в отдельную папку в папку MQL5/Experts. Содержание архива:
 
Sysmart:
We need a simple Expert Advisor on mql5. At the beginning of its work, should appear 2 buy/sell buttons, pressing one of them, should open a deal with parameters that are predefined and magic number. Once the button is pressed, it should disappear until the moment when there are no open positions on the given chart. If this time has come, the buttons should appear.

opens, removes buttons - if there are no positions, buttons will appear.

example-(just, put everything in its place).

//+------------------------------------------------------------------+
//|                                               удалить кнопки.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"
//---
#define  InpMagic 19789876535
//---
#include <Trade\PositionInfo.mqh>
//---
CPositionInfo  m_position; // trade position object
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   if(!m_position.Select(Symbol()))
     {
      CheckObject();
     }
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   if(ObjectFind(0,"BUY")==0)
     {
      ObjectDelete(0,"BUY");
     }
   if(ObjectFind(0,"SELL")==0)
     {
      ObjectDelete(0,"SELL");
     }
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   if(ObjectGetInteger(0,"BUY",OBJPROP_STATE)!=0)
     {
      ObjectSetInteger(0,"BUY",OBJPROP_STATE,0);

      //--- сюда BUY

      if(ObjectFind(0,"BUY")==0)
        {
         ObjectDelete(0,"BUY");
        }
      if(ObjectFind(0,"SELL")==0)
        {
         ObjectDelete(0,"SELL");
        }
      PlaySound("ok.wav");
     }
   if(ObjectGetInteger(0,"SELL",OBJPROP_STATE)!=0)
     {
      ObjectSetInteger(0,"SELL",OBJPROP_STATE,0);

      //--- сюда SELL

      if(ObjectFind(0,"BUY")==0)
        {
         ObjectDelete(0,"BUY");
        }
      if(ObjectFind(0,"SELL")==0)
        {
         ObjectDelete(0,"SELL");
        }
      PlaySound("ok.wav");
     }
//---
   if(!m_position.Select(Symbol()))
     {
      CheckObject();
     }
//---
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CheckObject(void)
  {
//---
   bool res=false;
     {
      ObjectCreate(0,"BUY",OBJ_BUTTON,0,0,0);
      ObjectSetInteger(0,"BUY",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-102);
      ObjectSetInteger(0,"BUY",OBJPROP_YDISTANCE,37);
      ObjectSetString(0,"BUY",OBJPROP_TEXT,"BUY");
      ObjectSetInteger(0,"BUY",OBJPROP_BGCOLOR,clrMediumSeaGreen);

      ObjectCreate(0,"SELL",OBJ_BUTTON,0,0,0);
      ObjectSetInteger(0,"SELL",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-50);
      ObjectSetInteger(0,"SELL",OBJPROP_YDISTANCE,37);
      ObjectSetString(0,"SELL",OBJPROP_TEXT,"SELL");
      ObjectSetInteger(0,"SELL",OBJPROP_BGCOLOR,clrDarkOrange);
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
Files:
 
Alexsandr San:

opens, removes buttons - if there are no positions, buttons will appear.

example-(just to put everything in its place).

In the Expert Advisor itself Lot Balanse Profit.mq544 kb

Here-

//+------------------------------------------------------------------+
//| Close selected position                                          |
//+------------------------------------------------------------------+
void ClosePosition(const string symbol)
  {
   if(InitTrade(symbol))
      m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbo
   PlaySound("ok.wav");
   CheckObject();
  }
//+------------------------------------------------------------------+

this would probably be redundant

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

The second option is how you can set things right

//+------------------------------------------------------------------+
//|                                               удалить кнопки.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"
//---
#define  InpMagic 19789876535
//---
#include <Trade\PositionInfo.mqh>
//---
CPositionInfo  m_position; // trade position object
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   if(!m_position.Select(Symbol()))
     {
      CheckObject();
     }
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   if(ObjectFind(0,"BUY")==0)
     {
      ObjectDelete(0,"BUY");
     }
   if(ObjectFind(0,"SELL")==0)
     {
      ObjectDelete(0,"SELL");
     }
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   CheckButon();
//---
   if(!m_position.Select(Symbol()))
     {
      CheckObject();
     }
//---
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CheckButon(void)
  {
//---
   bool res=false;
     {
      if(ObjectGetInteger(0,"BUY",OBJPROP_STATE)!=0)
        {
         ObjectSetInteger(0,"BUY",OBJPROP_STATE,0);

         //--- сюда BUY

         if(ObjectFind(0,"BUY")==0)
           {
            ObjectDelete(0,"BUY");
           }
         if(ObjectFind(0,"SELL")==0)
           {
            ObjectDelete(0,"SELL");
           }
         PlaySound("ok.wav");
        }
      if(ObjectGetInteger(0,"SELL",OBJPROP_STATE)!=0)
        {
         ObjectSetInteger(0,"SELL",OBJPROP_STATE,0);

         //--- сюда SELL


         if(ObjectFind(0,"BUY")==0)
           {
            ObjectDelete(0,"BUY");
           }
         if(ObjectFind(0,"SELL")==0)
           {
            ObjectDelete(0,"SELL");
           }
         PlaySound("ok.wav");
        }
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+
//| Check for long position closing                                  |
//+------------------------------------------------------------------+
bool CheckObject(void)
  {
//---
   bool res=false;
     {
      ObjectCreate(0,"BUY",OBJ_BUTTON,0,0,0);
      ObjectSetInteger(0,"BUY",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-102);
      ObjectSetInteger(0,"BUY",OBJPROP_YDISTANCE,37);
      ObjectSetString(0,"BUY",OBJPROP_TEXT,"BUY");
      ObjectSetInteger(0,"BUY",OBJPROP_BGCOLOR,clrMediumSeaGreen);

      ObjectCreate(0,"SELL",OBJ_BUTTON,0,0,0);
      ObjectSetInteger(0,"SELL",OBJPROP_XDISTANCE,ChartGetInteger(0,CHART_WIDTH_IN_PIXELS)-50);
      ObjectSetInteger(0,"SELL",OBJPROP_YDISTANCE,37);
      ObjectSetString(0,"SELL",OBJPROP_TEXT,"SELL");
      ObjectSetInteger(0,"SELL",OBJPROP_BGCOLOR,clrDarkOrange);
      res=true;
     }
//--- result
   return(res);
  }
//+------------------------------------------------------------------+

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

Expert Advisor attached with the second option !!!

Files:
 
Alexsandr San:

In the Expert itself Lot Balanse Profit.mq544 kb

Here-

this is probably unnecessary

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

The second option is how you can put things in their proper place

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

The Expert Advisor attached with the second option !!!

There is a lot of unnecessary stuff in the expert, with my knowledge I won't be able to weed out the unnecessary stuff.

 
Sysmart:

There is a lot of unnecessary stuff in the Expert Advisor, with my knowledge I won't be able to weed out the unnecessary stuff.

So I have chewed it up - all you need to do is to insert it all into your code https://www.mql5.com/ru/forum/35071/page120#comment_16528116

You have to insert all you need in itBut theLot Profit.mq545 kb. (It still needs a lot of things to be inserted)

Reason: