Questions from Beginners MQL5 MT5 MetaTrader 5 - page 239

 

In the documentation, there is an example of"Bringing data like simple structures".

When you compile, you get a warning. I don't like to accumulate and drag a bunch of potential error messages behind me.

Question: how to avoid this?

struct str1
  {
   double  d;
  };
//---
struct str2
  {
   long    l;
  };

void OnStart()
  {
   str1 s1;
   str2 s2;
   s1.d=MathArcsin(2.0);
   s2=s1;          // Warning: implicit struct cast
  }
 
micle:

In the documentation, there is an example of"Bringing data like simple structures".

When you compile, you get a warning. I don't like to accumulate and drag a bunch of potential error messages behind me.

Question: how to avoid this?

Withdrawing the question. You have to do it like this.

s2=(str2)s1;
 

When trying to publish a picture from MT4 in the journal, the messageImages: failed send request (login.mql5.com:443 failed) appears.

What can it be related to? Moreover, until recently everything was working, but now I can't publish screenshots


 
Hello! I just started to study the market and I want to know if it is possible to install signals, indicators, if no Metatrader is installed?
 
vialet:
Hello! I just started to study the market, I want to know if it is possible to install signals, indicators, if no MetaTrader is installed at all?
Start with the documentation and your questions will go away.
 
vialet:
Hello, I just started to study the market, I want to know if it is possible to install signals, indicators, if there is no MetaTrader installed?
There are different platforms for trading forex/bourses. MetaTrader versions 4 and 5 are the most popular. If we further talk about this platform, all kinds of signals/indicators/advisors work under this platform, so you cannot use signals/indicators/advisors if you do not have MT installed.
 

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?

double             Custom(int index)                   { return(m_ind.ParamDouble(index));}

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

3. I cannot understand how the program gets the indicator value. 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 am not going further, since I need to get some Expert Advisor on my creation.

#include <Expert\ExpertSignal.mqh>
//+------------------------------------------------------------------+
//| Класс CSampleSignal.                                             |
//| Назначение: Класс генератора торговых сигналов.                  |
//|             Является производным от класса CExpertSignal.        |
//+------------------------------------------------------------------+
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; }
   //--- метод проверки параметров настройки
   virtual bool       ValidationSettings();
   
   virtual bool       InitIndicators(CIndicators* indicators);

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)); }
  };
 
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'm not going to go further, since I need to get some Expert Advisor on my creation.

1. Right.

2. I don't understand. What oscillator do you use to write the signal? It's much more convenient to modify a ready-made oscillator than to write it from scratch.

3... Again, it's not clear. You need to understand what kind of indicator you are going to get the signal from.

If you do not mind, you can paste or attach the code in its entirety - along with the header.

About the generator of trading signals of custom indicator:

Генератор торговых сигналов пользовательского индикатора
Генератор торговых сигналов пользовательского индикатора
  • 2013.07.19
  • Karputov Vladimir
  • www.mql5.com
Как сделать генератор торговых сигналов основанный на пользовательском индикаторе. Как создать пользовательский индикатор. Как получить доступ к данным пользовательского индикатора. Зачем нужна конструкция IS_PATTERN_USAGE(0) и model 0.
 
barabashkakvn:

1. Right.

2. Not clear. And what oscillator are you writing the signal based on? It's much more convenient to modify a ready-made oscillator than to write it from scratch.

3... Again, it's not clear. You need to understand what kind of indicator you are going to get the signal from.

If you do not mind, you can paste or attach the code in its entirety - along with the header.

About the generator of trading signals of the custom indicator:

Good day!

You can use any generator. My main thing now is to understand and learn how to make it.

I took the "Blau_Ergodic" indicator from here https://www.mql5.com/ru/articles/190

I read your article, it's an indicator based on MACD. I need a fully custom indicator, so not sure how to apply it in my case.

I have understood the logic of getting price and indicator values in MQL5. Now I want to learn how to make a generator. And now I want to learn how to make a generator.

The Standard classes have been recommended to reduce the tester optimization time significantly, and I have already decided that I need a generator.

Индикаторы и торговые системы Уильяма Блау на MQL5. Часть 1: Индикаторы
Индикаторы и торговые системы Уильяма Блау на MQL5. Часть 1: Индикаторы
  • 2011.04.22
  • Andrey N. Bolkonsky
  • www.mql5.com
В статье представлено описание разработанных на MQL5 индикаторов по книге Уильяма Блау (William Blau) "Моментум, направленность и расхождение". Подход Уильяма Блау позволяет достаточно точно и с минимальным запаздыванием аппроксимировать колебания ценовой кривой, выделять тенденцию ценового движения и поворотные точки и устранять ценовой шум. При этом мы можем также получать сигналы о перекупленности/перепроданности рынка, сигналы об окончании тренда и о развороте ценового движения.
 
forexman77:

Good afternoon!

You can take any generator you like. The main thing for me now is to learn how to make it.

I took the "Blau_Ergodic" indicator from https://www.mql5.com/ru/articles/190.

I read your article, it's an indicator based on MACD. I need a fully custom indicator, so not sure how to apply it in my case.

I have understood the logic of getting price and indicator values in MQL5. Now I want to learn how to make a generator. And now I want to learn how to make a generator.

The Standard classes have been recommended to reduce the tester optimization time significantly, so I came to the need of the generator.

Hello.

I can't use "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 through the message in the profile).

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