Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1354

 
Vitaliy Atamanov #:
That's where I got to, but which section do I click on now?

Sorry, but is very clear. Think of it as Homework. I won't be able to answer any more.

Вопросы от начинающих MQL5 MT5 MetaTrader 5
Вопросы от начинающих MQL5 MT5 MetaTrader 5
  • 2021.10.01
  • www.mql5.com
Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000...
 
Vitaliy Atamanov #:
this is where i got to but which section do i have to click on now?

You are looking in the wrong place. Simply restart the MT5 terminal and open the "Journal" tab in the terminal.

 
You show me the information from the trading terminal, but I ask a question about the program Meta Tester5 Agents Manager in this program I have testing agents do not connect to the cloud - can this be because the system is Windows 10?
 
Vitaliy Atamanov #:
You show me the information from the trading terminal, but I have a question about the Meta Tester5 Agents Manager program, my agents are not connected to the cloud, may be it because the system is Windows 10?

You have a weak processor. You have very little RAM. Your CPU usage is often high. If you are asked to do , you must do it.

By the way, check in your MQL5 profile - whether agents appeared, and if so, what is their PR? (You need a screenshot).

Вопросы от начинающих MQL5 MT5 MetaTrader 5
Вопросы от начинающих MQL5 MT5 MetaTrader 5
  • 2021.10.01
  • www.mql5.com
Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000...
 

1. How do I make the service autostart when starting the MT5?

2. Does the service access data by a specific symbol? I.e. can I get iOpen() type with specifying tf symbol and other?

 

Hello, can you help me please? Question, how to pass the colour index to the Expert Advisor?

CopyBuffer(VHandle,3,0,3,lvcol1)<0. The buffer is INDICATOR_COLOR_INDEX
 
Oleg Kolesov #:

Hello, can you help me please? Question, how do you pass the colour index to the EA?

CopyBuffer(VHandle,3,0,3,lvcol1)<0. Buffer - INDICATOR_COLOR_INDEX

If you want to get a signal when you change colour.

Screenshot 2021-10-07 053809

For example, I get it like this

you need to see what buffer is in the indicator

it is 1 - I also write 1 in Expert Advisor (yellow)

//--- indicator buffers mapping
   SetIndexBuffer(0,BufferC,INDICATOR_DATA);
   SetIndexBuffer(1,BufferColors,INDICATOR_COLOR_INDEX);
   SetIndexBuffer(2,BufferB1,INDICATOR_CALCULATIONS);
   SetIndexBuffer(3,BufferB2,INDICATOR_CALCULATIONS);
   SetIndexBuffer(4,BufferB3,INDICATOR_CALCULATIONS);
   SetIndexBuffer(5,BufferB4,INDICATOR_CALCULATIONS);
   SetIndexBuffer(6,BufferB5,INDICATOR_CALCULATIONS);
   SetIndexBuffer(7,BufferB6,INDICATOR_CALCULATIONS);
   SetIndexBuffer(8,BufferMA,INDICATOR_CALCULATIONS);
//--- setting indicator parameters
//+------------------------------------------------------------------+
//| main function returns true if any position processed             |
//+------------------------------------------------------------------+
bool CSampleExpert::Processing(void)
  {
//--- refresh rates
   if(!m_symbol.RefreshRates())
      return(false);
//--- refresh indicators
   if(BarsCalculated(m_handle_macd)<2)
      return(false);
   if(CopyBuffer(m_handle_macd,1,0,2,m_buff_MACD_main)  !=2)
      return(false);
//   m_indicators.Refresh();
//--- to simplify the coding and speed up access
//--- data are put into internal variables
   m_macd_current   =m_buff_MACD_main[0];
   m_macd_previous  =m_buff_MACD_main[1];
//--- it is important to enter the market correctly,
//--- but it is more important to exit it correctly...
//--- first check if position exists - try to select it
   if(m_position.Select(Symbol()))
     {
      if(m_position.PositionType()==POSITION_TYPE_BUY)
        {
         //--- try to close or modify long position
         if(LongClosed())
            return(true);
         if(LongModified())
            return(true);
        }
      else
        {
         //--- try to close or modify short position
         if(ShortClosed())
            return(true);
         if(ShortModified())
            return(true);
        }
     }
//--- no opened position identified
   else
     {
      //--- check for long position (BUY) possibility
      if(LongOpened())
         return(true);
      //--- check for short position (SELL) possibility
      if(ShortOpened())
         return(true);
     }
//--- exit without position processing
   return(false);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Check for short position opening                                 |
//+------------------------------------------------------------------+
bool CSampleExpert::ShortOpened(void)
  {
   bool res=false;
//--- check for short position (SELL) possibility
   if(m_macd_current>m_macd_previous)
     {
 

SanAlex thanks for your help. I'm a little confused. Not the buffer number, but the colour index?

In Indicator.

int OnInit()
  {
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);                  // Точки после запятой
//---
   SetIndexBuffer(0,level1,INDICATOR_DATA);                        // Назначение массива буферу
   SetIndexBuffer(1,
levelcol1,INDICATOR_COLOR_INDEX);
//--- задаем количество индексов цветов для графического построения
   PlotIndexSetInteger(0,PLOT_COLOR_INDEXES,
3);
//--- задаем цвет для каждого индекса
   PlotIndexSetInteger(0,PLOT_LINE_COLOR,
0,LightSeaGreen);   
   PlotIndexSetInteger(0,PLOT_LINE_COLOR,
1,DimGray); 
   PlotIndexSetInteger(0,PLOT_LINE_COLOR,
2,Red);

In the Expert Advisor. 3 -colours. 3 situations.

//| Копируем значения индикаторов в массивы, используя хэндлы индикатора
//+---------------------------------------------------------------------+
   if(CopyBuffer(VHandle,0,0,3,lv1)<0 || CopyBuffer(VHandle,1,0,3,
lvcol1)<0)
     {
      Alert("Ошибка копирования буферов хэндла индикатора V2 - ошибка:",GetLastError(),"!!");
      return;
     }
 
Transfers lines. can't do anything. Exactly get a signal when the colour changes.
 
Oleg Kolesov #:
Transfers lines. can't do anything. Exactly get the signal when the colour changes.

1. Put the cursor at the beginning of the bottom line and press the delete button on the left.

2. Alexander answered correctly and even gave the code, but as usual it's a mess, but he highlighted what you need...

Your first buffer contains an index of the indicator colour. Since you have 3 colours in total, the values of this buffer can only be 0, 1 or 2. So, read the values of the first buffer into an array and check that this array contains 0, 1 or 2

Reason: