Questions from Beginners MQL4 MT4 MetaTrader 4 - page 178

 
Igor Makanu:

the task became more difficult... it didn't add up in my head overnight... I guess I'm not Mendeleev, so I can't do complex problems in my sleep )))


how to find the penultimate digit in the whole number!

101 --> 0

267 --> 6

?

Will it work or am I missing something?

Dividethe remainder of division by 100 by 10, rounding to the nearest lower number.

Print((int)floor(267%100/10));
 
Igor Makanu:

the task became more difficult... it didn't add up in my head overnight... I guess I'm not Mendeleev, so I can't do complex problems in my sleep )))


how to find the penultimate digit in the whole number!

101 --> 0

267 --> 6

?

will it work or am i missing something?

print all digits

   int n=2019; //цифра

   while(n != 0)
     {
      Print("_",n%10);
      n=n/10;
     }
 
Alexey Viktorov:

The remainder of division by 100 is divided by 10, rounded to the nearest lower one.

I know, but I don't want to leave int, floor() returns double

Taras Slobodyanik:

print all digits

it's logical, i need last but one digit of integer to be guaranteed, i'm working with magik numbers, i need "tens" (last but one digit) to calculate statistics for orders,

I checked my version, there shouldn't be any errors

I have doubts about the type conversion:

we have int x = 119 ---> x % 100 = 19 ---> x /10 = 1 - there should be no errors here

and here int x = 199 ---> x % 100 = 99 ---> x /10 = 9 - I doubt it, I checked it randomly, most likely it will work correctly

 
Igor Makanu:

Well, if only a second degree is needed, then I think this

int n=2019;             //цифра

int x=n%10;             //первый разряд
int x=(n/10)%10;        //второй разряд
int x=(n/100)%10;       //третий разряд
 
Taras Slobodyanik:

Well, if only the second digit is needed, I think so

Yes, probably your version is more reliable than my int y = (x%100 )/10;

letint y = (x/10)%10 be better;

OK. Thanks!

SZY: this would probably be a guaranteed type conversion, int(x/10) %10 ... I don't like working with type conversions in MQL, there were cases when I couldn't correctly guess which type the compiler would convert the result into

 
Good afternoon. What is the situation. I need an Expert Advisor/script/indicator/whatever I have written in mql4, it should not be attached to a chart window, it should be attached to a program... like, I will write a useful thing and I don't want to attach it to new open charts all the time, I just want it to stay. Something like a service (from MT5), but you need it on MT4.
 

Hello. Trying to understand the capabilities of a neural network.

I have read the description of using Fann2mql library.

But all attached sample EAs (NeuroMACD, OlegOlegovFANNv1) do not compile.

Error is the same :

'path' - parameter conversion not allowed NeuroMACD-fixed.mq4 88 29

'path' - parameter conversion not allowed OlegOlegovFANNv1.mq4 148 29

Obviously 'path' is a neural network name in string format.

Then it's not clear why the conversion is prohibited and what for is it anyway?

Judging by the comments to these programs, all of them compile without errors.

 
How do I contact technical support? Help?
 
regfiles:
How do I contact tech support? Help?

Ask here (or create a new topic)

 
regfiles:
How do I contact technical support? Help?
The technical support on this site is called ServiceDesk and it only deals with financial issues.
If the question is about programming, you should ask in the forum.