Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1165

 

Hello!
Can you tell me if there are any restrictions on the init() function ? If so, what are they, runtime or any other parameters ? And where can i read about it in documentation ?
And is there a difference in this, between MT4 and MT5 ?

 
Leo59:

Hello
Can you tell me if there are any restrictions on the init() function? If so, what are they, runtime or any other parameters ? Where can I read about it in documentation ?
And is there a difference in this, between MT4 and MT5 ?

In mql4 it is better to use OnInit(), OnDeinit() as well as other OnTick(), OnCalculate() instead of obsolete start() and other ones that I can't remember without looking into old code...
 
Leo59: Hello!

Can you tell me if there is a limit to the init() function ? If so, what are they, runtime or any other parameters ? And where can I read about it in documentation ?
And is there a difference in it, between MT4 and MT5 ?

Once I got interested in the sequence and execution time of functions OnInit OnDeinit OnTick OnTimer ... I wrote a simple Expert Advisor and placed loops with Sleep and Alert functions in all functions... It worked out very interesting ...

 
Эльнэ:
Help!
On account $ 12.93 I want to open an order with 0.01 volume, stop loss and take profit 0, but the program says not enough money-why?

you have to increase the leverage of your trading account at your broker's website,1:100 or 1:200 or 1:500

 

Gentlemen welcome!

I apologize in advance for the lamer question!

I haven't written in MQl4 for 100 years, but I've started again. The gist of the problem:

I am writing an indicator, I put values in the buffer - everything is beautifully drawn, I want to add one more buffer, but before that I should create one more array and work with it, and from it to the second buffer, so, in a simple loop, I equate the new array values to the buffer 0, I start to work with them, and there are zeros... I print them out - zeros... I write the new array as a buffer array - it all works... It's a mess... :( I'm getting stupid somewhere, but I don't know where.

 
Андрей:

Gentlemen welcome!

I apologize in advance for the lamer question!

I haven't written in MQl4 for 100 years, but I've started again. The gist of the problem:

I am writing an indicator, I put values in the buffer - everything is beautifully drawn, I want to add one more buffer, but before that I should create one more array and work with it, and from it to the second buffer, so, in a simple loop, I equate the new array values to the buffer 0, I start to work with them, and there are zeros... I print them out - zeros... I write the new array as a buffer array - it all works... It's a mess... :( I'm getting stupid somewhere, but I don't know where.

They know.

 
Alexey Viktorov:

They do.


I think I've covered everything, and I'll attach the code if you're interested tonight. I don't have it handy at the moment.


One more time in a simpler way then.

the code looks something like this:

...

double Buf0[]

double MuAg[]

....

while...

Buf0[i]=...

MuAg[i]=Buf0[i];

Print(DoubleToStr(MuAg[i]);

i--

...


and everything works, draws... Only in the printer:

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0


Does that make more sense?

 
Андрей:

Gentlemen welcome!

I apologize in advance for the lamer question!

I haven't written in MQl4 for 100 years, but I've started again. The gist of the problem:

I am writing an indicator, I put values in the buffer - everything is beautifully drawn, I want to add one more buffer, but before that I should create one more array and work with it, and from it to the second buffer, so, in a simple loop, I equate the new array values to the buffer 0, I start to work with them, and there are zeros... I print them out - zeros... I write the new array as a buffer array - it all works... It's a mess... :( I'm getting lost somewhere, but I don't know where.

Maybe it's like this.



int ArrayCopy(  object&dest[], object source[], int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)
Копирует один массив в другой. Массивы должны иметь одинаковый тип. Массивы типа double[], int[], datetime[], color[], и bool[], можно копировать как массивы одного типа.
Возвращает количество скопированных элементов.
 

There are many numbers - 1,3,4,8,9,........1000. How do I ELIGIBLY compare them, in the EA body, to a variable. Without equating each number to some variable ? Thank you !

 
Александр:

Maybe so.




Thanks for the tip, I'll check it out tonight!

Reason: