Errors, bugs, questions - page 568

 
x100intraday:

https://www.mql5.com/ru/docs/basis/function/events says at the end:"For a better understanding it will be useful to run the indicator whose code is attached below. "

Run the code. Over the weekend. No better understanding happened - it was fine as it was, I think, but the worst impressions were added. There are no ticks at the weekend, so prev_calculated = 0 at this time always, when going from timeframe to timeframe:

However, at one point this value appears (no reconnects, honestly noble!):


Should I expect the erratic behaviour of the terminal to be eliminated? Or should I learn the math?


Study, because it is written in the documentation - Technical Indicators:

All functions like iMA, iAC, iMACD, iIchimoku, etc., create a copy of corresponding technical indicator in global cache of client terminal. If a copy of indicator with these parameters already exists, a new copy is not created, but the counter of references to this copy is increased.

...

Note: repeated use of an indicator function with the same parameters within one mql5-program does not increase the reference counter many times, the counter will be increased only once by 1.

This means that when you first start the indicator (when you switch to a new timeframe for the first time), the indicator values have not yet been calculated, so prev_calculated=0. When you return to this timeframe, the indicator is not created again, since its handle is still alive. Therefore, prev_calculated!=0
 
x100intraday:

However, at one point this value appears (no reconnects, honestly noble!):

and funny lines on the graph:

or half as cheerful, like this:

There were even lines at the beginning of the story in the form of a ZigZag(alas, I forgot to take a screenshot and could not reproduce it).

Lines also appear on other TFs, but more sparsely. You can easily see it for yourself.

Was it exactly what the authors wanted to say?

Actually, there is a section called Variable Initialization:

Any variable can be initialised when defined. If a variable is not explicitly initialized, the value stored in that variable can be anything. Implicit initialization is not done.

You have declared an indicator buffer, but the values in it are not defined. Therefore, the executive system of the terminal allocates any available part of memory for it, where the indicator buffer with the values of Zigzag may occur.
 
x100intraday:

There was a recent situation where the design:

The program printed only value from the first Print, but it was useless to wait until the values of the array elements were printed. After removing the first Print and recompiling the cyclic output of array items started instantly. Is it a secret conspiracy of Prints against the MQL5-Community or am I the only one who is unlucky?

Additionally, I want to note that these strange cases of terminal's behaviour were not observed on an MT5 instance overloaded with chart windows, graphical objects and MQL programs, but only in a single clean (not counting an outline of a running indicator) chart window.

Write to Service Desk, they will sort it out.

PS And read the section Program running

 
Karlson:

Yeah...it's all the same in principle...

Out of 5 functions that use OrderSend(), two of them invariably give error Invalid Request.

I don't see any errors or fundamental differences from working variants.

The problem is in the Terminal version (build 540 of 11.11.11). The prophecy came true!!!

 
MoneyJinn:

Out of 5 functions that use OrderSend(), two of them constantly give error Invalid Request.

I don't find any errors or fundamental differences from working variants.

The problem is in the Terminal version (build 540 of 11.11.11). The prophecy came true!!!

I rewrote it all through CTrade very quickly, it works fine, easy and efficient.
 

fun weekend with the 540 build:


After installing it, it keeps popping up ==>

return code 10013 and invalid request when setting an order.

 
blef:

fun weekend with the 540 build:


After installing it, it keeps popping up ==>

return code 10013 and invalid request when setting an order.

Can you provide the source code for reproduction? Write to Service Desk please.
Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
Rosh:

Actually, there is a section called Initializing Variables:

You have declared an indicator buffer, but the values in it are not defined. Therefore, the executive system of the terminal allocates any available piece of memory for it, to which the indicator buffer with Zigzag values may occur.

Rosh, the irony of my situation is that I haven't run the ZigZag indicator or its counterparts for ages and the machine undergoes a daily hardwar reboot. I don't have any remnants of ZigZags or anything else in my memory.

About learning the basics - that's for sure, you can't do without it. The only question is whether she'll disappoint me...

 
x100intraday:

Rosh, the irony of my situation is that I haven't run the ZigZag indicator or its counterparts for ages, and the machine undergoes a daily hardwar reboot. I don't have any remnants of ZigZags or anything else in my memory.

About learning the basics - that's for sure, you can't do without it. It's just a question of whether she'll disappoint me...

Doesn't matter, rubbish in buffers can draw anything if you don't initialize them.

You are so coquettishly asking me to convince you of the futility of effort, we can't give any guarantees, as I know more than MQL5 out of you two - the Apprentice and MQL5.

 
Rosh:

You ask so flirtatiously to convince you of the futility of your efforts, no guarantees can be given,

Such requests are not so valuable, because they are not the point; personally, I remember one major explicit request to help find the problem with primary undrawing, even posted three source codes with explanations. The request went unnoticed - I had to rely on myself. Then a suggestion to look at a more complex code, which I still could not fix myself. That's all I'm missing at the moment.

And for valuable explanations and links to documentation - thanks as always, I will by all means look into it.

Rosh:

...Since I know more about MQL5 than you two - the Expert Advisor and MQL5.


You can tell a bird by its flight, and a programmer by its code. The offer to have a look at it still stands, facepalm guaranteed.