Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1478
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
and what do you mean by initialise))))) it's kind of unclear to the person)))))
Good evening, Valery! We open the article proposed to the person and find there first a brief description:
and then a more detailed one:
In general, he should at least read this article first. ))
Regards, Vladimir.
Good day everyone!
I am continuing my self-study and again encountered a confusion. Here is the script code:
The script was supposed to draw a trend line as a segment. To do this, I set the initial and the second point to draw this segment. The documentation also says that you need two anchor points to create a trend line. I think I have done everything as it should be done. In my understanding, the second point is also an extreme point, but for some reason it is drawn not a segment, but a ray.
Could you please tell me where I am mistaken?
Regards, Vladimir.
MrBrooklin #:
Thank you, Artyom! Man, I didn't have enough intelligence to understand such a simple and obvious thing. God bless you!
Regards, Vladimir.
Good morning and good mood, everyone!
That's it! "I'm coming, your roof!" That's me. I run the script:
and I get this:
and there should be two short positions. Could you please tell me where I have made a mistake?
Regards, Vladimir.
Good morning and good mood, everyone!
That's it! "I'm coming, your roof!" That's me. I'm running the script:
and I get this:
and there should be two short positions. Could you please tell me where I've made a mistake?
Regards, Vladimir.
The last two prints
are outputting the value of variables
which are initialised, but nothing was assigned to them further.
I.e. everything works as written - no miracles.
The last two prints
outputs the value of variables
which are initialised, but nothing was assigned to them further.
I.e. everything works as written - no miracles.
Hello, Alexander. That's where I was stumped. What should be assigned? I think the Calc_Pos(count_buy, countsell) function should work, or do I misunderstand?
Regards, Vladimir.
Hello, Alexander. That's where I got stumped. What should be assigned? I think the function Calc_Pos(count_buy, countsell) should work, or do I misunderstand?
Regards, Vladimir.
1. You declare and initialise two variables.
2. You pass their values to the function.
It is not quite clear why this is done.
Then you output the values of these variables. But they have not been changed anywhere,
respectively, and zeros are printed. Everything works as written.
P.S. Trying to figure out your plan: you can declare these two variables global.
For example, like this:
1. You declare and initialise two variables.
2. You pass their values to the function.
It is not quite clear why this is done.
Then output the values of these variables. But they have not been changed anywhere,
respectively and are printed with zeros. Everything works as written.
P.S. Trying to figure out your plan: you can declare these two variables global.
For example, like this:
Thank you very much, Alexander. Your correction made the code work. To be honest, I realised that I was confused in three pines myself. I need to study passing arguments to a function again. Apparently, I have a complete misunderstanding here.
Regards, Vladimir.
Thank you very much, Alexander. Your correction made the code work. To be honest, I realised that I was confused in three pine trees myself. I need to study passing arguments to a function again. Apparently, I have a complete misunderstanding here.
Regards, Vladimir.
Outputting variables to the global area is not passing arguments to a function...
Put & before variable names at the input to the function and all the problems will be solved.