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

 
Aleksandr Martynov:
Hello, MQL4. I decided to distribute the program text among include files, but MarketInfo function is unknown in it, i.e. its constants are not defined and, consequently, it generates an error during compilation

This is a standard function. It can be seen from any part of the program text, from any file. How did you do that?

 
Artyom Trishkin:

This is a standard function. It is visible from any part of program text, from any file. How did you do this?

I took the source code from MQL4 tutorial as an example and started modifying it to suit my needs. I copy lines from programs, where everything is ok, but when I transfer them to mqh they are "lost".

Oh, and after I updated my help, I'm sick of F1 toggling me from mql4 ME to mql5 help...
 
Aleksandr Martynov:

I've taken the source code from MQL4 textbook as an example and started modifying it to my own needs. I copy lines from programs, where everything is ok, but when I transfer them to mqh they "get lost".

And after help update I'm sick of F1 toggling me from mql4 ME to mql5 help...

I think you write the code for MQL4 in MetaEditor MQL5, and that's why MarketInfo() is not highlighted - MQL5 doesn't have such a function

https://www.mql5.com/ru/docs/marketinformation

https://docs.mql4.com/ru/marketinformation

PS: I have the same situation on my Windows 10 laptop after I have installed 2 terminals and run each terminal (МТ54 and МТ5) with /portable key to save space on SSD, I transferred all МТ to my hard drive, when МetaEditor5 is called instead of MetaEditor4 I cannot track this bug, but if I open MetaEditor from terminal, everything is OK

Документация по MQL5: Получение рыночной информации
Документация по MQL5: Получение рыночной информации
  • www.mql5.com
Получение рыночной информации - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

What a strange thing is going on here. I started to rewrite my indicator from mql4 to mql5 and opened both indicators in ME5. Pressing F1 in mq5 file opens mql5 help and pressing it in mq4 will open mql4 help. I am even surprised that it ...

Igor Makanu If you open a file from an explorer, the ME used last time will open.

 
Alexey Viktorov:

What a strange thing is going on here. I have started to rewrite my indicator from mql4 to mql5 and opened both indicators in ME5. Pressing F1 in mq5 will show mql5 help and pressing in mq4 will show mql4 help. I am even surprised that it ...

Igor Makanu If you open a file from an explorer, the ME used last time will open.

that's the way it works on my laptop, on a pc running Win7 with no problems at all

ZS: I, in principle, do not bother me on a laptop it, just from the terminal I call Metaetitor, have long been used to....da here's what would cause inconvenience is downloading from the Market, if the terminals work with the key \portable . If you download from the forum, through the browser an application from the Market, the terminal will be called without \portable key (which is expected) and then you can wonder where all the programs are lost ))), but then it is also a matter of habit - I download applications from the Market through the terminal. everything is OK too

 
Igor Makanu:

I think you are writing code for MQL4 in MetaEditor MQL5, that's why your MarketInfo() is not highlighted - this function does not exist in MQL5

https://www.mql5.com/ru/docs/marketinformation

https://docs.mql4.com/ru/marketinformation

I have the same situation on my Windows 10 laptop after I've installed 2 terminals and run each terminal (MT54 and MT5) with /portable key to save space on SSD, I transferred all МТ to my hard drive, when МТ5 instead of MetaEditor4 I cannot track this bug, but if I open MetaEditor from terminal, everything is OK

That would be great, but I don't have MetaEditor5 installed... Neither is the terminal, it's just when I updated the help it said it updates both 4 and 5, and I don't know which 5 I'm on... I work in MT4

I dont understand where the default settings are, the MQL4 terminal is specified in Navigator, but mqh compilation is for MT5 and help by default refers to MQL5 (((

 

Hello all.

Please help with the connection of the .MQH library

Immediately after running a test advisor program - stop

Log message :

2018.10.02 18:15:45.559 2018.06.01 00:00:00 Testing pass stopped due to a critical error in the EA

2018.10.02 18:15:45.559 2018.06.01 00:00:00 test EURUSD,H1: unresolved import function call

2018.10.02 18:15:45.559 2018.06.01 00:00:00 Cannot find 'calc' in 'my_func.ex4'


Import Dll in terminal enabled

Please ask the experts to look at the files and help sort it out.

Thank you all.

Files:
test.mq4  1 kb
my_func.mq4  1 kb
my_func.mqh  4 kb
 
Sergey Maksiutenko:

Hello all.

Please help with the connection of the .MQH library

Immediately after running a test advisor program - stop

Log message :

2018.10.02 18:15:45.559 2018.06.01 00:00:00 Testing pass stopped due to a critical error in the EA

2018.10.02 18:15:45.559 2018.06.01 00:00:00 test EURUSD,H1: unresolved import function call

2018.10.02 18:15:45.559 2018.06.01 00:00:00 Cannot find 'calc' in 'my_func.ex4'


Import Dll in terminal enabled

Please ask the experts to look at the files and help sort it out.

Thank you all.

//+------------------------------------------------------------------+
//|                                                         test.mq4 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

#include <my_func.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
Alert("calc = ", calc (1,2));
   
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                                                      my_func.mqh |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property strict

int calc (int a,int b)
{
int c = a + b;
return(c);
}
 
Hopefully, you can spread these two files out into folders.
 
Alekseu Fedotov:
I hope you can put the two files in folders.

The files are in the appropriate folders.

What's the problem?

Reason: