Questions from Beginners MQL5 MT5 MetaTrader 5 - page 240

 
barabashkakvn:

Hello.

1. I cannot use the "Blau_Ergodic" indicator because there is no archive at the end of the article. Now I need an include file " WilliamBlau.mqh". Please send me this file (better via profile message).

2. All indicators are in...MQL5\Indicators\Examples\ - these are custom indicators, i.e. those indicators, which code you can modify.

Sent.
 
forexman77:

I am trying to build a trading signal generator based on a custom indicator.

The following questions have arisen:

1. I can specify any name in the line after CiCustom, for example mark it as "m_ind;".

2. Is this line correct?

I understand correctly, here I get the value of the indicator itself?

3. I cannot understand how the program gets the indicator value. I.e., if we use MQL4, we should specify the indicator name and the program will find it by name. Then where do I enter its name in the class?

I have created this code) I won't go further, because I need more Expert Advisor on my creation.

In general, everything is correct. Here is just the code:

   double             Custom(int index)                   { return(m_ind.ParamDouble(index));}
   double             Open(int index)                     { return(m_open.GetData(index));  }
   double             Close(int index)                    { return(m_close.GetData(index)); }

raises a question. ParamDouble - gets the value of a specified floating-point parameter, which was used in creation of the indicator. Maybe we need to access the value of the indicator buffer:

   double             Custom(int index)                   { return(m_open.GetData(index));  }
   double             Open(int index)                     { return(m_open.GetData(index));  }
   double             Close(int index)                    { return(m_close.GetData(index)); }

?

 
barabashkakvn:

All in all, everything is correct. Except the code:

raises a question. ParamDouble - gets the value of the specified floating-point parameter, used when creating the indicator. Maybe we need to access the indicator buffer value:

?

Looking at the help, it seems to me that " ParamDouble" is needed. We actually need to get the value from the buffer.

I found only "NumBuffers" in the"CiCustom" class

 
forexman77:
Looking at the help, it seems to me that it needs " ParamDouble". Generally, of course, you need to get the value from the buffer.
Well, I can see that everything will work out for you.
 
barabashkakvn:
Well, I see that everything will work out for you.
If I understand correctly
double             Custom(int index)                   { return(m_ind.ParamDouble(index));}

is the indicator value requested with this line?

In standard indicators the buffer values are obtained through data access, but there is nothing about data access in the custom indicator.

There are functions in the group of basic and auxiliary classes of technical indicators and timeseries, but how do I attach them? Or it is not the right one?

 
forexman77:
If I understand correctly

is the indicator value requested with this line?

In standard indicators the buffer values are obtained through data access, but there is nothing about data access in the custom indicator.

There are functions in the group of basic and auxiliary classes of technical indicators and timeseries, but how do I attach them? Or it is not the right one?

1. Yes the parameter value - for example the input parameter on which the indicator will be calculated.

2. Do not confuse - the indicator in which you can change the code is a custom indicator. Even if its name is the same as the indicator that comes in the standard library. An example of a custom indicator - ...MQL5\Indicators\Examples\ and any others where you can change the code. The indicator buffer draws its content (data) on the chart. You simply change data in indicator buffer and it is drawn on the chart. What access are you asking about?

3. I don't get it.

 
barabashkakvn:

1. Yes parameter value - e.g. input parameter on which the indicator will be calculated.

2. Do not confuse - the indicator in which you can change the code is a custom indicator. Even if its name is the same as the indicator that comes in the standard library. An example of a custom indicator - ...MQL5\Indicators\Examples\ and any others where you can change the code. The indicator buffer draws its content (data) on the chart. You simply change data in indicator buffer and it is drawn on the chart. What access are you asking about?

3. I don't get it.

Here is the input parameter period, which is used to calculate the indicator "q"

class CSampleSignal : public CExpertSignal
  {
protected:
   CiCustom           m_ind;              // объект для доступа к значениям ind
   CiOpen             m_open;            // объект для доступа к ценам открытия баров
   CiClose            m_close;           // объект для доступа к ценам закрытия баров
  //--- настраиваемые параметры
   int      q;  // q - период, по которому вычисляется индикатор
   double             m_stop_loss;       // уровень установки ордера "stop loss" относительно цены открытия
   double             m_take_profit;     // уровень установки ордера "take profit" относительно цены открытия
public:
              CSampleSignal();
   //--- методы установки параметров настройки
   void               Q(int value)                 { q=value;   }
   void               StopLoss(double value)       { m_stop_loss=value;   }
   void               TakeProfit(double value)     { m_take_profit=value; }

To question 2. Now the following code

protected:
   //--- метод инициализации объектов
   bool               Initind(CIndicators* indicators);
   bool               InitOpen(CIndicators* indicators);
   bool               InitClose(CIndicators* indicators);
   //--- методы доступа к данным объектов
   double             Custom(int index)                   { return(m_ind.ParamDouble(index));}//знаю, что не правильно
   double             Open(int index)                     { return(m_open.GetData(index));  }
   double             Close(int index)                    { return(m_close.GetData(index)); }
  };

If I understand correctly, we specify here that we want to receive information about open and close prices, values from indicator buffers?

I understand what you mean with the standard indicators. The data from the buffer is obtained through"Main". For example, it is shown in the code below

 double             MA(int index)                       { return(m_MA.Main(index));       }
 double             Open(int index)                     { return(m_open.GetData(index));  }
 double             Close(int index)                    { return(m_close.GetData(index)); }

To the 3rd question. How to get data from the custom indicator?

For better understanding, briefly what steps must be passed in the process of creating the generator of the trading signal?

 
If I understand correctly, we specify here that we want to get information about open and close prices, values from indicator buffers?

Yes.

The standard indicators are clear. The data from the buffer is retrieved via "Main". For example, as in the code below.

Yes. The CiMA class has theMain method

How to get data fromthe custom indicator?

.GetData(index))
where index is indicator buffer number.
 
barabashkakvn:

Yes.

Yes. The CiMA class has aMain method

where index is the indicator buffer number.
double             Main(int ind)                       { return(m_ind.GetData(0,ind));   }
Right)?
 


when will metatrader come out on windows phone 8

Reason: