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

 
Can anyone help me with this problem: https://www.mql5.com/ru/forum/329462?
В чем проблема при переходе с MQL4 на MQL5?
В чем проблема при переходе с MQL4 на MQL5?
  • 2019.12.30
  • www.mql5.com
Я попытался изменить код с MQL4 на MQL5. Проблема в том, что советник не работает, так как работает в MQL4...
 
Igor Makanu:

can, the code is for playback:

Where else can I see more complicated examples but just about the function classes I don't understand what they are for?

 
Igor Makanu:

you can, code for playback:


Cool, I somehow missed that. So many OOP patterns can be implemented more easily. Strategy and State, for example, for example.

 
Aleksey Mavrin:

A good question contains the answer (C)

Roman Shiredchenko:

The function double - should return a value, if the function is void - no.

If you have variables defined above in your code, they can be commented out + you had extra spaces here (Bid > = L8b)) - made corrections:

Built it in, it worked thank you!
 

And guys, I found this code in one of the threads.

typedef int(*MyFuncType)(int,int);

int addition (int a, int b)
{ return (a+b); }

int subtraction (int a, int b)
{ return (a-b); }

int operation (int x, int y, MyFuncType myfunc)
{
   int g;
   g = myfunc(x,y);
   return (g);
}

int OnInit()
{
   int m,n;
   m = operation (7, 5, addition);
   n = operation (20, m, subtraction);
   Print(n);
   return(INIT_FAILED);  //just to close the expert
}
 

Good afternoon everyone.

I know it's probably a silly question, but I haven't found the error. Please help.

extern int shag_setki = 80;            
extern int position = 10;


Print("q = ", q, " OrderBufer_B[q].price = ", OrderBufer_B[q].price);
      tsS = NormalizeDouble(OrderBufer_B[q].price-shag_setki*position*_Point,_Digits);
            
Print("tsS = ", tsS);

In the terminal, the first Print - OrderBufer_B[q].price = 0.88448


I need the right price in tsS. The problem is that the Print says that tsS = 0.

What is wrong?

 

I want to learn how to make an intuitive and user-friendly interface in MQL4/5 for Expert Advisors and indicators

Not like the standard one - the variable name and its value in the "Input parameters" tab. And I want to have sub-tabs, so that when you activate one parameter a group of other parameters would be available, for example to place squares-buttons 4 in a row and 4 in a column with a picture inside each square, etc...


What do you recommend to study, which library? VERY IMPORTANT - I learn everything from videos, repeating examples and then trying to create something similar but different, it's pretty hard for me to learn programming from help/documents. Please advise - are there any video tutorials on what I need for MQL4/5? I just can't find it on youtube or it's not there.

 
Alexandr Sokolov:

I want to learn how to make an intuitive and user-friendly interface in MQL4/5 for Expert Advisors and indicators

Not like the standard one - the variable name and its value in the "Input parameters" tab. I want to have sub-tabs, so that when you activate one parameter a group of other parameters would be available, for example, you could have squares-buttons 4 in a row and 4 in a column with a picture inside each square, etc...


What do you recommend to study, which library? VERY IMPORTANT - I learn everything from videos, repeating examples and then trying to create something similar but different, it's pretty hard for me to learn programming from help/documents. Please advise - are there any video tutorials on what I need for MQL4/5? I either haven't found it on youtube or it's not there.

If it is for yourself and your inner circle, then C# is the best option.

I don't know if it's available on Sharp, or if it's not.

And then read a couple of instructions "how to make sharp and MQL5 friendly".

 
Alexandr Sokolov:

What type of tsS variable?

Thank you. :) It helped.

 
Maxim Kuznetsov:

If you want to use C# for yourself and your inner circle, then C# is the best choice.

there are plenty of good tutorials on Sharp, from the microsoft website to intuit.

and then read a couple of tutorials on "how to get Sharpe and MQL5 together".

Thanks! What if for commercial purposes?

Reason: