[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 386

 
Vinin:

What operating system and on what disk is the terminal installed?


I found another funny thing, one robot when tested with different brokers on their terminals mt4, gives different test results because of the absence of quotes, both one and another! But with all this there is no misalignment errors at all??? I'm shocked !?!??

The butterfly effect is on its face)))

Who thinks so?

 
How do I use indicator and Expert Advisor files in EX4?
 
Las-tochka:

You just transfer them to a chart, set parameters and use


Although not this is better)))

File Types


In MQL4 there are 3 types of files with program code: mq4, ex4 and mqh.

Files of mq4 type are the source code of a program. Files of this type contain source codes of all types of programs (Expert Advisors, scripts and indicators). For creation of codes of programs MetaEditor is used. After a program code is completely or partially completed, it can be saved and later re-opened in this editor for further modifications. Files of mq4 type cannot be used for execution in the client terminal. To start a program for execution, it must be compiled beforehand. After compilation of the program source code, a file with the same name and with the ex4 extension is created.

An ex4 file is a compiled program that is ready for practical use in the client terminal. For files of this type the possibility of editing is not provided. If one needs to make changes in a program, one should address to its source code (mq4 file), edit it and then compile it again. The name of an ex4 file does not allow to determine the type of programs it refers to - whether it is a script, an Expert Advisor or an indicator. The ex4 files can be used as library files.

Files of mqh type are include files. This is the source code of frequently used blocks of user programs. Such files can be included in the sources of Expert Advisors, scripts and custom indicators at the compiling stage. Usually included files contain descriptions of functions to be imported (see for example the files stdlib.mqh or WinUser32.mqh) or descriptions of common constants and variables (stderror.mqh and WinUser32.mqh). As a rule, mqh files are stored in the directory Directory_terminal\experts\include.

The include files are so called because they are usually "included" at the stage of compilation to the main source file using the #include directive. In spite of the fact that mqh files can contain the source code of a program and MetaEditor compiles them, they are not independent and self-sufficient, i.e. they do not require compilation in order to produce executable files of the ex4 type. .mq4 files can also be used as include files, which must also be stored in terminal_directory\experts\include .

In the navigator of the client terminal in sections "Expert Advisors", "Custom Indicators" and "Scripts" only those file names are displayed that have the extension ex4 and are located in the corresponding directory. Files compiled in an older version of MetaEditor are not started and are grayed out.

There are also other types of files that do not form a complete program, but are used when creating application programs. For example, a program can be compiled from several separate files or a previously created library can be used for this purpose. Libraries of user functions can be created by the user to store frequently used blocks of user programs. It is recommended to store the libraries in terminal_directory\experts\libraries. The mq4 and ex4 files can be used as libraries. Libraries cannot be launched by themselves. The use of include files is preferable to the use of libraries, because of the additional consumption of computer resources when calling library functions.

In the first part of the tutorial "Introduction to MQL4 Programming", we will be interested in source code files of mq4 programs and compiled files of ex4 programs.

 
where do I put it to apply it on the graph?
 
Las-tochka:


I found another funny thing, one robot, when tested with different brokers on their terminals mt4, gives different test results because of the absence of quotes, both one and the other! But with all this there is no misalignment errors at all??? I'm shocked !?!??

The butterfly effect is on its face)))

What do you think?

I think the tester does not have to show the potential profit/losses reliably, it is only to see if the EA logic is working correctly and if all the maths and logic errors in the code are ok.
 

BeerGod:
Думаю что тестер никоем образом не обязан достоверно показывать потенциальную прибыль/убытки, он лишь для того чтобы увидеть правильно ли рабоает логика советника, всё ли в порядке с математикой и логическими ошибками в коде.

Is there any information on the merits of the question?

The question is not about profit. What the tester is for, in my opinion, is a tool, and how to use it is up to each of us.


 
Myth63:
Where should I put it in order to use it on the graph?


If you want to run an expert or an indicator or a script on a chart, simply left-click on the corresponding programme in the toolbar of the navigator and drag it onto the chart.

But it's better to download the tutorial from https://book.mql4.com/ru/ at the bottom left of the page) Good luck!

 

Good day!

I use an indicator that shows MAs from other periods.

I put a couple of them in the window, the terminal starts to slow down terribly!

Experts, what is the problem with the slowness of the indicator, it has only 15 lines?

Fix who understands.

I am grateful to you.

#property indicator_chart_window
#property indicator_buffers 1

extern double tf = 240; // Тф с какого береть МА
extern int period = 34; // Период МА
extern string _МА_ = "0--SMA 1--EMA 2--SMMA 3--LWMA";
extern int method = 2; // Метод МА
extern int price = 4; //
extern int shift = 0; //

extern string _LINE_ = "ЦВЕТ ТОЛЩИНА СТИЛЬ БАР";
extern color clr = Yellow; // Цвет линии
extern int width = 2; // Толщина линии
extern int style = 2; // Стиль линии
extern int CountBars = 500; // Количество баров отрисовки МА

datetime time_0;
double ma[];
//+------------------------------------------------------------------+
int init() {
//----
SetIndexBuffer(0, ma);
SetIndexStyle(0, DRAW_LINE, style, width, clr);
SetIndexLabel(0, "MA " + tf);
IndicatorShortName("Moving Average (" + tf + ", " + period + ")");
if (CountBars >= Bars)
CountBars = Bars;
SetIndexDrawBegin(0, Bars - CountBars + 1);
return (0);
}
//+------------------------------------------------------------------+
int start() {
//----
int cb = IndicatorCounted();
SetIndexDrawBegin(0, Bars - CountBars + 1);
int i = Bars - cb - 1;
double ctf = Period();
double r = tf / ctf;
while(i >= 0) {
int k = MathFloor(i / r);
ma[i] = iMA(Symbol(), tf, period, shift, method, price, k);
i --;
}
if (Time[0] == time_0) return (0);
time_0 = Time[0];
return (0);
}
//+------------------------------------------------------------------+

 
Myth63:
Where should I put it in the graph?
The experts to the folder experts, and all other types are similar by name. After restarting the terminal, they will be available in the navigator, but they will be grayed out, unlike the ones that have the source code.
 

Hello, please advise: My problem is the following: in the Expert Advisor, there should be only one signal to trade (when all three indicators have crossed their respective zones)

if(SignalType_1 && (RSI >= 35 && Stoch >= 20 && CCI >= -100)) return(+1)

Here is the question. How to write this line correctly, so that there is only ONE signal. (Otherwise, it turns out that the Expert Advisor makes deals according to the following algorithm: RSI crosses the line 35 - deal; STOCH crosses the line 20 - deal; CCI crosses the line -100 - deal; it makes three deals)

There is only ONE trade signal when all three indicators have crossed their zones