A word of advice, please: when creating the function ObjectCreate (when creating a trend line), I get a ray, which, following from one point to another has a continuation on the chart only to the right side.
DemanRap: So the ray that goes from one point to the next only continues to the right-hand side of the graph, but how can I make it continue to the left-hand side?
Can't you draw a ray to the left, or do you want a straight line instead of a ray?
I want my robot to be able to track where this ray would be on historical data. For example, I want to check how close it would be to other fractals, not just the 2 fractals on which I originally built it.
Thank you very much, but it turned out to be much simpler. I just drew another ray and swapped time1, price1 and time2 price2 in it. but it took me a whole day to figure it out)))
they store some time in the variable file :-) date of access, name and value of type double
The question about GV variables is as follows... In S.K.'s book on MQL4, in chapter "GlobalVariables" in section "Properties of GV-Variables" it is written: "A GV variable can only be of type double". Below, in the section "Function GlobalVariableDel()", there is an example of expert globalvar.mq4 with the following content:
//--------------------------------------------------------------------// globalvar.mq4// Предназначен для использования в качестве примера в учебнике MQL4.//--------------------------------------------------------------------int Experts; // Колич. экспертовdouble Depo=10000.0, // Заданный депозит
Persent=30, // Заданный процент
Money; // Искомые средстваstring Quantity="GV_Quantity"; // Имя GV-переменной//--------------------------------------------------------------------int init() // Спец. функция init
{
Experts=GlobalVariableGet(Quantity); // Получим тек. знач.
Experts=Experts+1; // Колич. экспертовGlobalVariableSet(Quantity, Experts); // Новое значение
Money=Depo*Persent/100/Experts; // Средства для эксп.Alert("Для эксперта в окне ", Symbol()," выделено ",Money);
return; // Выход из init()
}
//--------------------------------------------------------------------int start() // Спец. функция start
{
int New_Experts= GlobalVariableGet(Quantity);// Новое колич. эксп.if (Experts!=New_Experts) // Если изменилось
{
Experts=New_Experts; // Теперь текущ. такое
Money=Depo*Persent/100/Experts; // Новое знач. средств Alert("Новое значение для эксперта ",Symbol(),": ",Money);
}
/*
...
Здесь долен быть указан основной код эксперта,
в котором используется значение переменной Money
...
*/return; // Выход из start()
}
//--------------------------------------------------------------------int deinit() // Спец. ф-ия deinit
{
if (Experts ==1) // Если эксперт один..GlobalVariableDel(Quantity); //..удаляем GV-переменelse// А иначе..GlobalVariableSet(Quantity, Experts-1); //..уменьшаем на 1Alert("Эксперт выгружен из окна ",Symbol()); // Сообщ. о выгрузкеreturn; // Выход из deinit()
}
//--------------------------------------------------------------------
Question: why in this example GV variables Expert and New_Expert are of int type. although, as stated earlier, these variables should be of double type?
It compiles without any problems, no errors, but it does not trade. I have tried to comment out different code blocks, but I have not found the culprit. I have not noticed any problems with logic.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
To get a straight line, try adding the highlighted lines
what about them? - global at terminal level?
they store some time in the variable file :-) date of access, name and value of type doubleThe question about GV variables is as follows... In S.K.'s book on MQL4, in chapter "GlobalVariables" in section "Properties of GV-Variables" it is written: "A GV variable can only be of type double". Below, in the section "Function GlobalVariableDel()", there is an example of expert globalvar.mq4 with the following content:
Question: why in this example GV variables Expert and New_Expert are of int type. although, as stated earlier, these variables should be of double type?
Good afternoon, can you tell me what might be wrong with the EA?
It compiles without any problems, no errors, but it does not trade. I have tried to comment out different code blocks, but I have not found the culprit. I have not noticed any problems with logic.