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

 
Vladimir Simakov:

I'm not talking about customers))) I'm talking about version control of a project. When a customer tells you that I want to roll back to this one, you not only have the ability to roll back, but also to create a new branch, plus you don't clog up the catalogue with a bunch of versions.

In general an idea))) in order not to litter your own shelves on the git to do))))
 
Valeriy Yastremskiy:
Actually an idea)))) so as not to litter one's own shelves on the git to do))))
So, maybe I'll become a trendsetter here)))) IMHO, a distributed system of version control looks more fun here than a centralized one. And the local, out of the box, glitchy seemed to me. Although, maybe I was too lazy to learn how to cook it?) In general, use git and sleep well)))
 

Greetings. Please help me out. I have this question. Do I understand correctly. The program is executed from the beginning to the end, but stops when an event occurs, e.g. a tick, the ontick function starts to execute, then it finishes its execution and the program is executed again from the beginning? This question is related to the following, where do I write for example the size of the trading lot, in the program body or in the ontick function?

I look at the official bot, which is like an example in the terminal, there calculation of the lot is performed in the program body, and I do not understand why so.

 
Igor Makanu:

I thought it needed some kind of protection, I just have no idea how to change EA's name programmatically - that's why I was surprised by such a binding ))))

Don't know how to change it either. Create a new one and copy. But μl has a hitch with reading files with μl extension)
 
Ivan_Invanov:

Greetings. Please help me out. I have this question. Do I understand correctly. The program is executed from the beginning to the end, but stops when an event occurs, e.g. a tick, the ontick function starts to execute, then it finishes its execution and the program is executed again from the beginning? This question is related to the following, where do I write for example the size of the trading lot, in the program body or in the ontick function?

I look at the official bot, which is an example in the terminal, there calculation of the lot is performed in the program body, and I do not understand why so.

No. The tick does not break the Expert Advisor. If the Expert Advisor is working, the incoming ticks are skipped. When it finishes, the next tick will start it again in standby mode.
 
Valeriy Yastremskiy:
No. The tick does not interrupt the Expert Advisor. If the Expert Advisor is working, the incoming ticks are skipped. When finished, the next tick will restart it in standby mode.
Valeriy Yastremskiy:
No. The tick is not cut by the expert. If the EA is working, incoming ticks are skipped. When it finishes, the next tick will restart it in the standby mode.
Valeriy Yastremskiy:
No. Expert Advisor does not interrupt the tick. If the expert is working, the incoming ticks are skipped. When it is done, the next tick will restart it in the standby mode.

Kalash or Maxim? ))))))))))))


Question:

I have a script. It cannot be launched from the EA using the standard means. So, we have to add it to the Expert Advisor as a function. But I do not want to make the same changes in the Expert Advisor when editing the script. How to do it? By Inclusions?

 
Valeriy Yastremskiy:
No. The tick does not break the Expert Advisor. If the EA is running, incoming ticks are skipped. When finished, the next tick will restart it in standby mode.

Thank you. Only I didn't understand anything at the time. I took the EA template that came with the terminal as my template. And that's how the functions are written there.

function to set the lot volume

check whether to open a deal or not

check if a deal will be closed or not

initialize

on each tick

{ check if trade will be closed or not

otherwise check whether to open the deal or not}

deinitialise

So when will the program go to the lot setting function? After executing "on every tick" ? And will it execute once ?

 
Explain how to use the debugger as well, I enable debugging on real data and the add to observation button is unavailable, always unavailable.
 
Ivan_Invanov:

Thank you. Only I didn't understand anything at the time. I took the EA template that came with the terminal as my template. And that's how the functions are written there.

function to set the lot volume

check whether to open a deal or not

check if a deal will be closed or not

initialize

on each tick

{ check if trade will be closed or not

otherwise check whether to open the deal or not}

deinitialise

So when will the program go to the lot setting function? After executing "on every tick" ? And will it execute once ?

I could be wrong, but I don't think you have any idea how the EA works at all. What do you mean by "program executes"?

A tip - first of all, understand what is OnInit, OnTick and OnDeinit. I think that everything will fall into place ))))

 
Сергей Таболин:

I could be wrong, but I don't think you have any idea how the EA works at all. What do you mean by "program is running"?

A tip - first of all, find out what OnInit, OnTick and OnDeinit are. I think that everything will fall into place ))))

Yeah, I don't get it, that's why I'm asking. I know that ontick is an event, but I don't understand where the EA goes afterwards. It will then go to the body of the program and calculate the lot volume, or it won't? Why is the EA from the official publisher written that way?