How without an object, we know the price and this is the line, it is necessary to check whether it has changed or not, it is clear that it is necessary to compare this price I do not know how)
what kind of
where to get a measure of Price2))
the price at the last bar and will be Price2, compare Bid with any price of the last bar of your choice - Open, Close, High, Low.
If you want intermediate prices, you need to save the tick history and take the previous price from there, then the Bid will be compared to the price of the previous tick.
And what is the sense of price normalization? You need to normalize calculated values that will be used in trade orders later, and the price is already normalized.
The search method in the one below is slightly different:
#property strict/******************************************************************************/bool AddValue(double &array[], constdouble value) {
constint size = ArraySize(array);
if (ArrayResize(array, size + 1) != size + 1) {
returnfalse; // Ошибка, значение не может быть добавлено к массиву
}
array[size] = value; //записываемreturntrue; // Нет ошибки, значение добавлено к массиву
}
/******************************************************************************/bool AddValueIfFound(double &array[], conststring name) {
constint type = ObjectType(name);
if (type == OBJ_TREND) {
switch ((color)ObjectGet(name, OBJPROP_COLOR)) { // Тип color допустимо использовать в switchcase Goldenrod:
case Gainsboro:
case White:
if (!AddValue(array, ObjectGetValueByShift(name, 1))) {
returnfalse; // Ошибка, значение найдено, но не может быть добавлено к массиву
}
}
}
returntrue; // Нет ошибки, значение, если найдено, добавлено к массиву
}
/******************************************************************************/bool MassTrendNumber(double &array[], constbool buy) { // Поиск значения цены трендовой линии, текущего бара, запись в массив. Два массива: masS и masBconststring subname = (buy ? "uptrendline" : "downtrendline"); // существует два названия трендовых линий, первое и второеif (ArrayResize(array, 0) != 0) {
returnfalse; // Ошибка, массив не может быть заполнен достоверно
}
for (int i = 0, limit = ObjectsTotal(OBJ_TREND); i < limit; i++) {
if (!AddValueIfFound(array, subname + IntegerToString(i))|| !FilTrenLin(subname+IntegerToString(i))) { \\ Вот куда вставилreturnfalse; // Ошибка, массив, если и заполнен, то недостоверно
}
}
returntrue; // Нет ошибки, массив заполнен достоверно
}
/***************************************************************************/boolFilTrenLin(string name) {
const string dt_123 = TimeToStr(TimeCurrent(),TIME_SECONDS); //const datetime vremnin= StrToTime(dt_123); // Присваиваем время в секундах const datetime vrem2kor= ObjectGet(name,OBJPROP_TIME2);// время второй координатыMqlDateTime str1;
TimeToStruct(vrem2kor,str2);
const int PjatPon=str1.sec;
if(PjatPon+3600>=vremnin){ \\ если время 2-ой координаты + час > времени нынешнего то блокируем запись в массивPrint(" PjatPon ", PjatPon," vremnin ",vremnin," vrem2kor ",vrem2kor);
returnfalse;
}
returntrue;
}
/******************************************************************************/void FillAndPrint(double &array[], constbool buy) {
if (MassTrendNumber(array, buy)) {
constint limit = ArraySize(array);
Print("Найдено объектов: ", limit);
for (int i = 0; i < limit; i++) {
Print("Price[", i, "] = ", DoubleToStr(array[i], Digits));
}
} else {
Print("Чёрт!");
}
}
Don't think of it as cheeky, Idon't even know how to address it anymore, but I can't help it. I thought that if I could make up an array, then the conditions would be hammered out, filtering the signal like nothing else.
Don't mind me, Idon't even know how to address it anymore, but there's nothing I can do about it.I thought that if I could make an array, then the conditions would be a pain in the ass to filter the signal.
We can go to the other side, not to get the difference of moments in time, but to compare these moments (at the same time, we can use a conditional expression again):
01:30:29 Script 2 EURUSDm,H1: loaded successfully
01:30:292 EURUSDm,H1: initialized
01:30:312 EURUSDm,H1: Момент времени dt НЕ достигнут
01:30:332 EURUSDm,H1: Момент времени dt НЕ достигнут
01:30:352 EURUSDm,H1: Момент времени dt достигнут
01:30:382 EURUSDm,H1: Момент времени dt достигнут
01:30:382 EURUSDm,H1: uninit reason 001:30:38 Script 2 EURUSDm,H1: removed
After understanding the essence of the applied ideas, and remembering what the datetime type is, working with moments of time, if the required accuracy does not exceed units of seconds, should not cause difficulties.
We can go in the other direction as well, not to get the time moments difference, but to compare these moments (at the same time, we can use a conditional expression again):
Running gives:
Once you understand the ideas, and remembering the datetime type, working with points in time should be no problem, as long as the required precision does not exceed units of seconds.
To be honest, I haven't figured out how to apply it. There's a millimetre to go, it's a shame to stop when it's almost finished.
Task, don't write price to array if object time(2nd parameter+3600sec>current)||(1st parameter time - 2nd parameter time)<3600sec )
/******************************************************************************/bool MassTrendNumber(double &array[], constbool buy) { // Поиск значения цены трендовой линии, текущего бара, запись в массив. Два массива: masS и masBconststring subname = (buy ? "uptrendline" : "downtrendline"); // существует два названия трендовых линий, первое и второеif (ArrayResize(array, 0) != 0) {
returnfalse; // Ошибка, массив не может быть заполнен достоверно
}
for (int i = 0, limit = ObjectsTotal(OBJ_TREND); i < limit+2; i++) {
if (!AddValueIfFound(array, subname + IntegerToString(i))||!FilTrenLin(subname + IntegerToString(i)) {// Условие вставил вот сюдаreturnfalse; // Ошибка, массив, если и заполнен, то недостоверно
}
}
returntrue; // Нет ошибки, массив заполнен достоверно
}
/***************************************************************************/bool FilTrenLin(string name) {
constdatetime dt = TimeCurrent();
constdatetime dt1 = ObjectGet(name,OBJPROP_TIME1);
constdatetime dt2 = ObjectGet(name,OBJPROP_TIME2);
Print(" DiffInSecs(dt,dt2) ", DiffInSecs(dt,dt2)," DiffInSecs(dt2,dt1)) ",DiffInSecs(dt2,dt1)," dt1 ",dt1);
if(DiffInSecs(dt,dt2)<3600||DiffInSecs(dt2,dt1)<3600)// Если время объекта второго параметра + 3600 сек > текущего времени,
или если разница первого и второго параметра времени объекта < 3600 сек, то запускаем ошибку, чтоб цена не записалась в массив.
{ returnfalse;
}
returntrue;
}
/******************************************************************************/long DiffInSecs(constdatetime dt1, constdatetime dt2) {
return dt1 - dt2;
}
I can't think of anything) there is a line And how do I check if the line has changed
I can't think) there is a line And how do I check if this line has changed
CHARTEVENT_OBJECT_CHANGE
Changing the properties of a graphical object via the properties dialog
CHARTEVENT_OBJECT_CHANGE
Changing the properties of a graphical object via properties dialog
How without an object, if we know the price is a line, we have to check if it has changed, it is clear that we have to compare the price.)
what kind of
where to get a measure of Price2))
How without an object, we know the price and this is the line, it is necessary to check whether it has changed or not, it is clear that it is necessary to compare this price I do not know how)
what kind of
where to get a measure of Price2))
the price at the last bar and will be Price2, compare Bid with any price of the last bar of your choice - Open, Close, High, Low.
If you want intermediate prices, you need to save the tick history and take the previous price from there, then the Bid will be compared to the price of the previous tick.
And what is the sense of price normalization? You need to normalize calculated values that will be used in trade orders later, and the price is already normalized.
the price on the last bar will be Price2
If you want intermediate prices, you have to save the tick history and take the previous price from there.
Got it all figured out :)
No, it wouldn't work with my bars.
The search method in the one below is slightly different:
Don't think of it as cheeky, Idon't even know how to address it anymore, but I can't help it. I thought that if I could make up an array, then the conditions would be hammered out, filtering the signal like nothing else.
Don't mind me, Idon't even know how to address it anymore, but there's nothing I can do about it.I thought that if I could make an array, then the conditions would be a pain in the ass to filter the signal.
The TimeCurrent() function is overloaded. If you read the description of the datetime type, you will see that the first function's first variant will do:
It does:
We can go to the other side, not to get the difference of moments in time, but to compare these moments (at the same time, we can use a conditional expression again):
Startup gives:
After understanding the essence of the applied ideas, and remembering what the datetime type is, working with moments of time, if the required accuracy does not exceed units of seconds, should not cause difficulties.
The TimeCurrent() function is overloaded. If you read the description of what the datetime type is, you will find that the first version of the function is fine:
It does:
We can go in the other direction as well, not to get the time moments difference, but to compare these moments (at the same time, we can use a conditional expression again):
Running gives:
Once you understand the ideas, and remembering the datetime type, working with points in time should be no problem, as long as the required precision does not exceed units of seconds.
To be honest, I haven't figured out how to apply it. There's a millimetre to go, it's a shame to stop when it's almost finished.
Task, don't write price to array if object time(2nd parameter+3600sec>current)||(1st parameter time - 2nd parameter time)<3600sec )
Hello comrades!
MT5 has such wonderful and very useful tools "Pulse Elliott Wave" and "correcting Elliott Wave".
The question is: Can I integrate these tools from MT5 into MT4?
I trade in MT4. It is not very convenient to move to MT5 for analysis.
Or: What are the other ways to solve the issue?