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

 
-Aleks-:

Is there an alternative to converting int to double for mathematical actions?

ProcTotalSell=(double)NOL_Sell/(double)N_Sell*100.0

I don't understand why you need to convert it to strings as well

 
Maxim Kuznetsov:

ProcTotalSell=(double)NOL_Sell/(double)N_Sell*100.0

and why you are converting it into strings is not clear at all

Because I did not understand how to convert double to int - except through strings!

I haven't seen anything about (double) in the Help - although I've seen such a solution before - I forgot - I don't understand where this syntax comes from at all!?

Thanks.

 
-Aleks-:

Yes, because I did not understand how to convert double to int - except through strings!

I did not see anything about (double) in the Help - although I have seen such a solution before - I forgot - I did not understand where such syntax comes from at all!?

To sum it up, I recommend you to study C/C++/C# at least at minimum level.

The syntax comes from C :-) By the way, I strongly recommend you to study C/C++/C# (at least at minimum level) before you do anything serious in MQL.

 
Maxim Kuznetsov:

The syntax is taken from C :-) By the way, I strongly recommend to study (at least at minimum level) C/C++/C# before taking up anything serious in MQL.

It would be nice to study it, but I have no time to do it all... I am thankful that there are helpful people in this thread, who may share the secrets of other languages.

 
Hello, I have a question. When a new bar appears, the bar index shifts, right?
If the close price of the first bar is higher than the price of the seventh bar, we buy.
There appears the next bar, we check the condition of the seventh bar, but it is not the seventh bar but the eighth,
How can I check the condition while it is correct and go back to the bar?
 
FOTOGRAF14:
Hello, I have a question. When a new bar appears, the bar index shifts, right?
If the close price of the first bar is higher than the price of the seventh bar, we buy.
There appears the next bar, we check the condition of the seventh bar, but it is not the seventh bar but the eighth,
How can I check the condition while it is correct and go back to the bar?

Look for the right bar by date.

 
-Aleks-:

Learning would be great, but there's no time to do it all... The good news is that there are helpful people in this thread who can explain the mysteries of other languages.


I had the same problem when I wrote a dozen or so codes and once you fix them, the problem goes away!
 
-Aleks-:

Search for the right bar by date.


Thanks ! I'll give it a try !
 
-Aleks-:

Learning would be great, but there's no time to do it all... The good news is that there are helpful people in this thread who can explain the mysteries of other languages.


Responsive people eventually disappear giving way to others (who are not too lazy to read). Those who don't read all ask questions and can't give answers.
 
Victor Nikolaev:

Responsive people eventually disappear, giving way to others (who are not too lazy to read). Those who don't read all ask questions and can't give answers

I feel like I've been accused of something...
Reason: