Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1028

 
Artyom Trishkin:
I cannot check it - I am writing from mobile phone. Try to start with only one consciousness. Without loops and arrays of timeframes. Just directly create one handle. If it's ok, add a second, third...
When everything is working, start creating in a loop with the masses. Also one at a time. This way you'll understand the cause or place of the hang-up faster.

I've already tried it. Only the current TF works.

 
Artyom Trishkin:
Why do you use a custom MACD? Have you tried the standard one?

Tried it with the standard one - it's the same... the terminal hangs up

handles[p]=iMACD(NULL,Periods[p],12,26,9,PRICE_CLOSE);
 
Tango_X:

Already tried it. only the current TF works

So, the non-native TF in the tester hangs? Does the tester window hang? Does it come to OnTick()?
 
Artyom Trishkin:
I.e., does the non-native tf in the tester hang? Does the tester window hang? Does it get to OnTick()?

Not even coming out with OnInit... it feels like I'm requesting non-existent data. There should be a message in the log after each handle request, but there are no such messages. It just hangs and that's it. Can it be related to outputs and how should it be then?

 
Tango_X:

Not even coming out with OnInit... it feels like I'm requesting non-existent data. There should be a message in the log after each handle request, but there are no such messages. It just hangs there...

Try to access any timeseries of desired characters first. Maybe the characters are not selected in the tester.
 
Artyom Trishkin:
Try referring to any timeseries of the desired characters first. Maybe the symbols in the tester are not selected.

does not work, only current period

for(int p=0; p<NUMBER_OF_PERIODS; p++)
        {
         if(handles[p]==INVALID_HANDLE)
           {
            //handles[p]=iCustom(NULL,PERIOD_H1,"Examples\\MACD");
            //handles[p]=iMACD(NULL,Periods[p],12,26,9,PRICE_CLOSE);
            handles[p]=iMACD(NULL,PERIOD_CURRENT,12,26,9,PRICE_CLOSE); только текущий период работает
            Print("Хэндл == ",handles[p]);
            if(handles[p]==INVALID_HANDLE)  Print("Не удалось получить хэндл индикатора для символа !");
           }
 
Put up a new terminal, same broker, same tester settings, problem disappeared... some glitch in the terminal probably... no point in sorting it out I think...
 
Why is the custom indicator not drawn during the visual test (although the data from its buffers is read)? But it is on the graph after the test. Where should I dig?
 
Сергей Таболин:
Why during the visual testing the custom indicator is not drawn (although the data from its buffers are read)? But it is present in the chart after the test. What to dig?

You must be asking all the wrong questions... )))

 

advise how to determine the day in mt5 ? an analogue of DayOfYear from mt4

this is the function to write

if (TimeDayOfYear(transaction_time)==DayOfYear())