I am planning an EA with functions that on every tick will loop through the available orders created by it and act depending on the situation.
Can you advise how to make separate variables for each new order and for further loops to work with them? (I assume this is something like Peremennaja+ticket=12345;)
I am planning an EA with functions that on every tick will loop through the available orders created by it and act depending on the situation.
Can you advise how to make separate variables for each new order and for further loops to work with them? (I assume this is something like Peremennaja+ticket=12345;)
Preferably an array or even an array of structures.
If you know two coordinate points of the slope line and paste them as paramaters of this function, the output will give you the price of the point on the bar_to_search. It only remains to call this function in the bar loop and compare the value it returns with the price of the horizontal line. If on the last bar of the cycle the value returned by the function was lower or equal to the price of the horizontal line, and on the current bar of the cycle the value returned by the function is greater than the line price, then the X coordinates of the crossing point will be the time corresponding to the cycle index and the Y coordinates will be the price returned by the function.
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.
something like this :
string level="Level"+IntegerToString(iTime(_Symbol,iBarShift(OrderCloseTime())); // ид.уровня - по времени бара (!! не по тикету)
if (ObjectFind(level)==-1) {
// гор.вектора нет - видимо первый ордер из закрытых на баре
// сделать горизонтальную линию
ObjectCreate(0,level,OBJ_TREND,0,OrderCloseTime(),OrderClosePrice(),OrderCloseTime()+PeriodSeconds(_Period)*3,OrderClosePrice);
// указывающую только вправо
ObjectSetInteger(level,OBJPROP_RAY,1);
ObjectSetInteger(level,OBJPROP_RAYLEFT,0);
// украсить её как-то :-)
ObjectSetInteger(level,OBJPROP_COLOR,....)
....
} else {
// гор.уровень есть - значит были ордера закрытые на этом баре
// по фантазии - обновить метки/корректировать уровень/etc
}
Using a vector as a level finder is wrong.... not good ....((
What if we make a horse move)
In the level search use the principle of profit summation at the price level the record of which already exists...
For example: here we've made a try and added up the profits with a 60 second delay
Next, we need to come up with a record :
If the number of accumulated profits at the level > 1, then this is our order - our level, from this level we draw a ray
Greetings.
I am planning an EA with functions that on every tick will loop through the available orders created by it and act depending on the situation.
Can you advise how to make separate variables for each new order and for further loops to work with them? (I assume this is something like Peremennaja+ticket=12345;)
Greetings.
I am planning an EA with functions that on every tick will loop through the available orders created by it and act depending on the situation.
Can you advise how to make separate variables for each new order and for further loops to work with them? (I assume this is something like Peremennaja+ticket=12345;)
Better an array or even an array of structures.
I'm sorry, can you elaborate?
Excuse me, could you go into more detail?
Here and here.
A structure and an array of structure type is created. Outside of all the code.
Hello.
Please help me find the intersection of the horizontal line "ResisL" andthe trend line by the angle "TrndL"
Hello.
Please help me find the intersection of the horizontal line "ResisL" andthe trend line by the angle "TrndL"
Thank you.
How about if you want to know the crossover point when there are no bars yet, i.e. a date in the future.
Thank you.
How about if you want to know the crossover point when there are no bars yet, i.e. a date in the future.
Haven't tried this function - need to experiment.
Haven't tried this function - need to experiment.
Please, if you find time to experiment, share the result.
Because I have no idea what to experiment with
.