**Guin:**

Hello.

Started studing MQL5 3 days ago. My first language. Been looking at the Reference a lot. Some explanations there are a bit vague, so I still dont fully understood some concepts.

Return operator: The return operator terminates the current function execution and returns control to the calling program.

What is the "calling program"? Is it the "On Tick()" function? When return operator is activated, it returns control to On Tick() and then On Tick() proccess the next function in the line until the end of all functions?

And about loop: lets say

for(i=0;i<rates_total;i++).

rates_total is the number of bars in the chart, correct? So it will grow every timeframe cycle. Lets say it is 100 bars now. The On Tick() function will be processed, the i will arrive at 100 and the loop will stop. Ok.

Then a new bar is created. rates_total is now 101. When On Tick() starts the loop again,will the i be ZERO again (and the loop will work again until 101) or will it still be 100 (and the loop will pass only one more time to reach 101)?

I know i can use prev_calculated to not have to proccess everything again, but i just want to understand how loop works.

For now thats the more pressing doubts. I really apreciate any help, any indications of tutorials. Thanks!!

I think you need to start with the basics. Basically if someone explains, you can not evaluate the explanation.

When studying Mql5 it is best to use the Mql5 documentation, using Mql4 will confuse you even more, because it is not the same.

Hello.

Started studing MQL5 3 days ago. My first language. Been looking at the Reference a lot. Some explanations there are a bit vague, so I still dont fully understood some concepts.

Return operator: The return operator terminates the current function execution and returns control to the calling program.

What is the "calling program"? Is it the "On Tick()" function? When return operator is activated, it returns control to On Tick() and then On Tick() proccess the next function in the line until the end of all functions?

And about loop: lets say

for(i=0;i<rates_total;i++).

rates_total is the number of bars in the chart, correct? So it will grow every timeframe cycle. Lets say it is 100 bars now. The On Tick() function will be processed, the i will arrive at 100 and the loop will stop. Ok.

Then a new bar is created. rates_total is now 101. When On Tick() starts the loop again,will the i be ZERO again (and the loop will work again until 101) or will it still be 100 (and the loop will pass only one more time to reach 101)?

I know i can use prev_calculated to not have to proccess everything again, but i just want to understand how loop works.

For now thats the more pressing doubts. I really apreciate any help, any indications of tutorials. Thanks!!