Questions from Beginners MQL5 MT5 MetaTrader 5 - page 185

 
Vikon:

Hi.

I'm trying to convert to five, but I still don't understand the logic of syntax.

How to convert double i= iHigh(Symbol(),0,1); from indicator four to mql5,

I can not give any idea yet.

Thanks

double i[]; CopyHigh(Symbol(),PERIOD_CURRENT,0,1,i);
 
pronych:
double i[]; CopyHigh(Symbol(),PERIOD_CURRENT,0,1,i);

No, you can't do it like mql4, you can't give a high value on alert

double i= iHigh(Symbol(),0,1);

Alert (i);

And you offer me, as I understand it, an array of int bars with maximal values.

Here is the problem in my understanding, how to translate these two strings, that are clear to any level programmer, into mql5

 
Vikon:

No, you can't do it like mql4, you can't give a high value on alert

double i= iHigh(Symbol(),0,1);

Alert (i);

And you offer me, as I understand it, an array of int bars with maximal values.

This is the difficulty in my understanding, how to translate these two strings, that are understandable to any level programmer, into mql5

This is from the help
int  CopyHigh(
   string           symbol_name,      // имя символа
   ENUM_TIMEFRAMES  timeframe,        // период
   int              start_pos,        // откуда начнем 
   int              count,            // сколько копируем
   double           high_array[]      // массив для копирования максимальных цен
   );

All correctly you have been advised, but if the bar in the alert is not zero, you have to copy 2 buffers (or how many you need to apply).

double i[];
ArraySetAsSeries(i,true); // массив как таймсерия
CopyHigh(Symbol(),PERIOD_CURRENT,0,2,i);
Alert(i[1]);
 
lewvik:
This is from the help

All correctly advised you, only if the bar on the alert is not zero you need to copy 2 buffers (or how many you need to apply)

It's working fine. Thanks

 

Hello!

Question about indicators, here I want to write a MACD indicator that will use four MACD timeframes on any timeframes for this I use the MACD indicator handle which is in OnInit and in Start the array copying and sequencing functions.

So my questions are:

How many handles should I declare four (for each timeframe) or one.

If one, what possibility is there to change parameters during code execution for four timeframes.

Maybe a handle can be rolled into a function and called in the code for the given timeframes

 
I wonder if there is an article somewhere like "the most common reasons for EA slowness"? I'm trying to understand why the EA in the tester just flies at the beginning, but the further it goes, the slower it gets. It is not on the stage of development for it to be that critical (the speed is enough for development of basic mechanisms and tools). But it's still uncomfortable that it doesn't make sense to take more than a week, because after that the speed tends to zero.
 
Lone_Irbis:
I wonder if there is an article somewhere like "the most common reasons for EA slowness"? I'm trying to understand why the EA in the tester just flies at the beginning, but the further it goes, the slower it gets. It is not on the stage of development for it to be that critical (the speed is enough for development of basic mechanisms and tools). But it is still inconvenient that it makes no sense to take segments longer than a week, because after that the speed already tends to zero.
Most likely uses indicators with calculation of the whole history, which increases by the end of the test.
 
Lone_Irbis:
I wonder if there is an article somewhere like "the most common reasons for EA slowness"? I'm trying to understand why the EA in the tester just flies at the beginning, but the further it goes, the slower it gets. It is not on the stage of development for it to be that critical (the speed is enough for development of basic mechanisms and tools). But it's still inconvenient that it makes no sense to take segments longer than a week, because after that the speed already tends to zero.
As an alternative: divide test period in two and run it in the tester separately. In this way we can determine whether there are just less signals to the input for the specified period.
 
zfs:
Most likely uses indicators with calculation of the whole history, which increases by the end of the test.

Doesn't use any external indicators at all so far. But it performs quite a lot of calculations based on history, yes. However there seems to be a limit on the maximum number of analyzed candlesticks, and if the reason is them, it is not clear why it slows down gradually, instead of slowing down from the beginning (it seems that the interval is always taken from the present moment).

 
Lone_Irbis:

Doesn't use any external indicators at all so far. But it performs quite a lot of calculations based on history, yes. However, there seems to be a limit on the maximum number of analyzed candlesticks, and if that is the reason, it is not clear why it would slow down gradually, instead of slowing down from the beginning (it seems that the segment is always taken from the present moment).

And "quite a lot of calculations based on history" add up to a dynamic array?
Reason: