Errors, bugs, questions - page 2938

 
Since there are no quotes on weekends, does it mean that the server does not give the history either? In my opinion, this is an unlikely assumption, but there were reasons to think so, because at weekends the indicator either does not work, or after the tedious and persistent switching of the TFs and switching of the indicator input parameters in the settings window, the long-awaited results were obtained, although they should have happened at any settings configurations.
Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Среди программ для автоматического трейдинга можно выделить две большие категории: торговые роботы и индикаторы. Первые предназначены для совершения торговых операций на рынках, а вторые — для анализа котировок и выявления закономерностей в их изменении. При этом индикаторы могут использоваться непосредственно в роботах, образуя полноценную...
 
x572intraday:

Yes, I remember it perfectly: doing a fake history pre-loading attempt at OnInit. Didn't work there or in OnCalculate, even in a loop with a hundred repetitions. I don't know how it actually works, but outwardly there was no promised history loading (albeit with a delay), the result remained unsatisfying until the end.

Moreover, there were other cases where the response was repeatedly returned:

but in the end there was no continuation of the indicator, there was silence in the response.

There is no need to do cycles with repetitions.

If it is an indicator, make a single request for the right symbol-period in OnCalculate. If it failed, then return(0)

Take receipt time of tick of required symbol, normalize this time to the beginning of required period, ask 1 last bar of required symbol-period and check its time. Then ask for the timing status of the history

Depending on your computer's sluggishness and resource load, more than one hundred OnCalculate can go through.

That code you're referring to is very old. But it is good for illustration. But it is not suitable for indicators, because history requests from indicators are executed without any waiting (which is clearly written in documentation) and Sleep in indicators is useless.

 
x572intraday:
Since there are no quotes on weekends, does it mean that the server does not give the history? I think this is an unlikely assumption, but there were reasons to think so, because at weekends the indicator either does not work, or after the tedious and persistent switching of the TFs and switching of the indicator input parameters in the settings window, the long-awaited results were obtained, although they should have happened with any settings configurations.

The server gives the history even on weekends.

Control the construction of bars by the time of the last tick of the appropriate symbol

 
Slava:

If it's an indicator, do a one-time request for the required character-period in OnCalculate. If failed, then return(0)

Well return(false) in case of failure is a classic. So I do. All would be fine, but the problem is that my further calculations are tied to successful loading of history (and this logic can not change), and in the case of failure and return from the calculations function, they just won't happen and further graphical constructions do not get the needed coordinates, everything crashes. How to avoid this - have not thought of yet and do not expect to change something too. So far I have the following: either all of the history is loaded and all timeseries for all timeframes are built and the indicator works almost immediately without missing any calculations due to return(false), or part of the history is missing, and the codereturns to a higher level function withreturn and tries to request the missing history in an endless loop, which leads to nothing. I simply refused the third variant - without return - and some calculations fail, which makes drawing of graphics incomplete.

Still sitting in the tank a bit, I'm still perplexed... Is it real to organize the MQL-logic of the indicator to work only with the local history, without the need to download the missing history and to suffer from delays because of it? Or any functions of Copy... ... inevitably have to contact the server to download even that part of the history, which I don't need for processing? Simply speaking, the standard indicators are instantly drawn on the existing history on my PC, without any downloading (I searched indicators in the Examples folder and there they use only CopyBuffer(), and not in all of them)... Or resumption is hidden from eyes? What is the purpose of resuming?

Thank you. I will think about your recommendations - probably, they will be useful to me.

Документация по MQL5: Константы, перечисления и структуры / Константы индикаторов / Стили рисования
Документация по MQL5: Константы, перечисления и структуры / Константы индикаторов / Стили рисования
  • www.mql5.com
Стили рисования - Константы индикаторов - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

I was away from the computer for a few hours. During this time, an abnormal situation occurred and the robot started stitching a lot of prints. As a result, the disk is completely clogged. This disrupts the work of the terminals, because they cannot dump their price history onto the disk.


We have to prevent such clogging of disk. One of alternatives is to prohibit writing to the folder. I.e. to live without logs on disk always. Another option is to kill log files when there is not enough free space left.

Has anyone solved this problem.

 
Slava:

If it's an indicator, do a one-time request for the required character-period in OnCalculate. If it fails, then return(0)

And if you want to run indicator on weekend?

Only forced call of OnCalculate from timer (with all ensuing crutches in the form of copying arrays to pass by reference)?

 
x572intraday:

Is it realistic to organize a non-redundant MQL-logic of the indicator to work only with the local history, without the need to download the missing one and suffer the delays associated with it? Or any functions of Copy... ... inevitably have to access the server to download even that part of the history, which I don't need for processing?

You could make your own cache(write to files).

When this was suggested to me, I, of course, twisted my temple, but it's really better than waiting for MQ to change its approach to time-series handling.

 
fxsaber:

I was away from the computer for a few hours. During this time, an abnormal situation occurred and the robot started stitching a lot of prints. As a result, the disk is completely clogged. This disrupts the work of the terminals, because they cannot dump their price history onto the disk.


We have to prevent such clogging of disk. One of alternatives is to prohibit writing to the folder. I.e. to live without logs on disk always. Another option is to kill log files when there is not enough free space left.

Has anybody solved this problem.

For the sake of interest I dashed over to check it and hit the floor with my jaw: 183 Gb! That's almost 4/5 of my SSD. Virtual machine images take less. At least I'll have something to read in my old age...

Виртуальный хостинг для MetaTrader 5
Виртуальный хостинг для MetaTrader 5
  • www.mql5.com
Самый быстрый виртуальный выделенный сервер (VPS) для трейдинга на форексе от производителей терминала MetaTrader 4/5
 
x572intraday:

Just for fun, I rushed over to check my house and hit the floor with my jaw: 183GB! That's almost 4/5 of my SSD. Virtual machine images take less. At least I have something to read in my old age...

Print and Alert are potentially dangerous functions.

 
All prices are displayed to the fifth decimal point, but one, for some reason, in the same list is displayed like this:
Price=0.7235200000000001
Why would it do that? Is it an error or we should adjust the output in a unified way? Well, let's say, I'll comb it with PrintFormat or fprint, but in principle it is not incorrect representation of the number?