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

 
MosheDayan:
about 25 people. For example: 14.02.2017 EURUSD 1.0630

Unfortunately, I don't see a solution to this problem purely with mql either.

Only create a letter template with the names of all the friends and mail

 
MosheDayan:
about 25 people. For example: 14.02.2017 EURUSD 1.0630
Do you have to broadcast the levels exactly? Wouldn't it be better to create a signal and broadcast it?
 

Hello.

I have killed all evening, but could not understand the reason, please help. The indicator should display data on the screen as a text mark, but when I start the terminal it does not happen, the mark appears only when I change the timeframe, then it works fine on ticks.

The example is simplified as much as possible, but the essence does not change:

int a=AccountInfoInteger(ACCOUNT_LEVERAGE);

intb=1000/a; // then print b on the screen

Using the method of elimination, I have concluded that this works only if I replace division with any other operation, or assign any constant to the variable "a".

I tried using ChartRedraw(), played with integer and double types, tried MathRound() and much more, nothing worked.

It's all strange.

 
Fam:

Hello.

I have killed all evening, but could not understand the reason, please help. The indicator should display data on the screen as a text mark, but when I start the terminal it does not happen, the mark appears only when I change the timeframe, then it works fine on ticks.

The example is simplified as much as possible, but the essence does not change:

int a=AccountInfoInteger(ACCOUNT_LEVERAGE);

intb=1000/a; // then print b on the screen

Using the method of elimination, I have concluded that this works only if I replace division with any other operation, or assign any constant to the variable "a".

I tried using ChartRedraw(), played with integer and double types, tried MathRound() and much more, nothing worked.

It's all strange.

So, what's the problem with multiplication instead of division?

intb=a*0.001;

And it's also important where exactly in the code to do the calculations. I hope it's not in the inite or on a global level? You could also divide by zero ;)

 
Fam:

Hello.

I have killed all evening, but could not understand the reason, please help. The indicator should display data on the screen as a text mark, but when I start the terminal it does not happen, the mark appears only when I change the timeframe, then it works fine on ticks.

The example is simplified as much as possible, but the essence does not change:

int a=AccountInfoInteger(ACCOUNT_LEVERAGE);

intb=1000/a; // then print b on the screen

Using the method of elimination, I have concluded that this works only if I replace division with any other operation, or assign any constant to the variable "a".

I tried using ChartRedraw(), played with integer and double types, tried MathRound() and much more, nothing worked.

It's all strange.

And if you look through the journal, you'll find the critical error "division by 0" there
 
Vitalie Postolache:

So what's the problem with redoing multiplication instead of division?

intb=a*0.001;

And it's also important exactly where in the code to do the calculations. I hope it's not in the inite or globally? You could also divide by zero ;)

That won't work, it's actually a variable instead of 1000. The calculation is inOnCalculate.
 
Vitalie Postolache:
Do the levels have to be transmitted exactly? Wouldn't it be better to create a signal and broadcast it?
I send them on Whatsapp to the group as well. I just wanted to make their life easier... to open the chart and my level is already there. Can you tell me more about the signal, is it via MT or a third party?
 
Alexey Viktorov:
And if you look in the log, you can find a critical error "division by 0" there

The logbook does indeed say: zero divide. I'm going to check it now.

I don't understand where does 0 come from? No data fromAccountInfoInteger(ACCOUNT_LEVERAGE) during initialization? And why doesn't the mark appear on next ticks?

 
MosheDayan:
I send them Whatsapp to the group as well. I just wanted to make life easier for them... to open the chart and my level is already there. Can you tell me more about the signal, is it by MT or a third party?
It is public:)
 
Fam:

The logbook does indeed say: zero divide. I'm going to check it now.

I don't understand where does 0 come from? No data fromAccountInfoInteger(ACCOUNT_LEVERAGE) during initialization? And why doesn't the mark appear on next ticks?

Because the program has received a critical error and is not executing further.

Maybe, some brokerage companies do not pass the leverage? Although, I haven't seen it in forex...