Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 668

 
Artyom Trishkin:

Do it. Then the code here.

By the way, Artem.

The task at hand brings up an interesting question.

In order to check EVERYTHING, you need an "import data" procedure.

That is to say, dynamic arrays should be loaded with their own dynamic data from third-party sources.

I don't know if MT4/MT5 have this procedure - or not?

How to import data in MT4/MT5?

Is this even possible???

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

I'm interested in importing dynamic data, not just reading data from an array.

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

By the way, this is where http://tol64.blogspot.com/2015/12/easy-and-fast-gui-mql.html this import should be by construction.

There's simply no way to do it without it.

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

I don't see the import in MT4/MT5 or their extensions.

Give me the import!!!

Библиотека "Easy And Fast GUI" для создания графических интерфейсов на MQL
  • tol64.blogspot.com
С этой статьи я начинаю еще одну серию, относящуюся к разработке графических интерфейсов. На текущий момент нет ни одной библиотеки кода, которая позволяла бы легко и быстро создавать качественные графические интерфейсы в MQL-приложениях. Я имею в виду графические интерфейсы, к которым мы все привыкли в известных операционных системах. Цель проекта — дать конечному пользователю такую возможность и научить это делать с помощью моей библиотеки. Я постарался сделать ее максимально понятной в изучении, с возможностями дальнейшего развития.
 
Aleksey Lebedev:

This is fierce nonsense, worthy to go into the annals of the forum.

"Ah, the moussa! Know she's strong,
"That barks at the elephant!"

https://ru.wikisource.org/wiki/%D0%A1%D0%BB%D0%BE%D0%BD_%D0%B8_%D0%9C%D0%BE%D1%81%D1%8C%D0%BA%D0%B0_(%D0%9A%D1%80%D1%8B%D0%BB%D0%BE%D0%B2)

Alexey!

I'll make a chop out of you, on the forum !!!

Sorry!

 

Good afternoon!

Could you please advise how to correctly implement filling of the indicator buffer with data by copying from the buffer of another indicator, called through iCustom? The idea is to be able to call the same indicator, built based on data of another instrument in the window of the current instrument.

As a result, the data buffer is empty, the chart is not plotted. The colour buffer is not important.

//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots   1
#property indicator_type1   DRAW_COLOR_HISTOGRAM
#property indicator_color1  Green,Red
#property indicator_style1  0
#property indicator_width1  3

//--- input data
input string OtherSymbol=""; //Название символа, по которому считать. Если пусто - текущий символ
//---- indicator buffers
double                    DataBuffer[];
double                    ColorsBuffer[];
//---- external indicator handle
int                       CustomHandle=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {  
   SetIndexBuffer(0,DataBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ColorsBuffer,INDICATOR_COLOR_INDEX);
   IndicatorSetString(INDICATOR_SHORTNAME,"PercentChangeHistogram");
   IndicatorSetInteger(INDICATOR_DIGITS,2);
//----
   if (OtherSymbol!="") //если есть имя другого символа, рекурсивно вызываем индикатор через iCustom 
      { 
      CustomHandle=iCustom(OtherSymbol,_Period,"PercentChangeHistogram","");
     if (CustomHandle==-1)
         {Alert ("iCustom function initialization failed!");
         return (INIT_FAILED);}
     }
   return (INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|  OnCalculate                                                     |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if(rates_total<2)
      return(0);
   int start=prev_calculated-1;
   if(start<1) start=1;
   //---
   if (OtherSymbol=="")// если input переменная содержит пустую строку, заполняем индикаторный массив через простой расчет функцией CalculateData
                       // если input переменная содержит не пустую строку, пытаемся заполнить индикаторный массив копированием данных другого индикатора
   CalculateData(start,rates_total,open,close);
   else
   CopyBuffer(CustomHandle,0,start,rates_total-prev_calculated,DataBuffer);
   //---
   return(rates_total);
  }
  
...
 
Aleksey Lebedev:

That's a load of bullshit worthy of the forum's annals.

Alexey!

How long have you been a trader? -

- None?

Traders used to reason plain and simple?

- What account do you have, Alexey - in plus or minus, and how many years?

- Or you have no trading account at all?

- Or, you're just brainless, and decided to teach other traders?

- There are a lot of them.

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

- I have a trader's account, and it's a decent one. A long time. 20 years. And I'm not going to teach anyone.

- That's the paradox.

 
neverness:

Alexey!

How long have you been a trader? -

- None?

Traders used to reason plain and simple?

- What account do you have, Alexey - in plus or minus, and how many years?

- Or you have no trading account at all?

- Or, you're just brainless, and decided to teach other traders?

- There are a lot of them.

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

- I have a trader's account, and it's a good one. A long time. 20 years. And I'm not going to teach anyone.

- That's the paradox.

You were given an answer on the technical side of the coin, and it should not be connected to the quality of trading at all.

 
Vitaly Muzichenko:

You have been given an answer on the technical side of the coin, and it should not be linked to the quality of trading at all.

Why is that?

Or do you think traders are "illiterate idiots" who gamble and bet on the market?

Then I am one of them.

Only I take the integral of dx without difficulty. And you? - What, do you have a problem?

You are obviously not a trader, as well as many other "experts" on this forum!

For a trader, the FOREX market is a "holy cow", which is ALWAYS RIGHT.

If you can push your idea through this market - you are a hero!

If the market overturns you, then you know what awaits you!

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

But no one gets banned in the Forex market - another paradox!!!

Whether you're right or wrong - it does not matter! Everything is paid for!!!

 
Artyom Trishkin:

Again. Look carefully at the picture:


Thank you for the clue.

 
neverness:

Why is that?

Or do you think traders are "illiterate idiots" who gamble and bet on the market?

Then I am one of them.

Only I take the integral of dx without difficulty. And you? - What, do you have a problem?

You are obviously not a trader, as well as many other "experts" on this forum!

For a trader, the FOREX market is a "holy cow", which is ALWAYS RIGHT.

If you can push your idea through this market - you are a hero!

If the market overturns you, then you know what awaits you!

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

But no one gets banned in the Forex market - another paradox!!!

Whether you're right or wrong - it does not matter! Everything is paid for!!!

You talk about arrays, and you talk about Forex! A paradox, however!

 
neverness:


- And I have a trader's account, and a decent one at that. For a long time. 20 years. And I'm not going to teach anyone.

- That's the paradox.

It feels like you're saying your age, not your seniority.
 

I've read your message, it all looks fine :-) but what about the question that provoked this confusion?

Declaring an array viaSetIndexBuffer(1, tmp1) doesn't do anything. Of course, I can increase array size in the same loop, but I want to know a simpler and more efficient way.