While the program is running, it is constantly changing. Help me write a condition: if Level has NOT changed, then do nothing. If Level has changed (no matter if it has changed up or down), then do some action { operator }
enter another variable
int Level1 = 0;
int Level = 0;
if (Level !=Level1)
{};
and then Level1 =Level
but I really don't understand why we need to pull an array on every tick if we can do it after any trade operation
I don't really understand why I need to pull an array at every tick, if I can do it after any trade operation
if(SELL_Lvl>0) { ObjectCreate("Sell no loss level", OBJ_HLINE, 0, 0, SELL_NoLossLevel); }
Further, I need it to happen when SELL_Lvl increases:
ObjectDelete( "Sell no loss level");
But, since theSELL_Lvl>0 condition is fulfilled, the line is redrawn again, but by a new value ofSELL_NoLossLevel. Is there an easier and more obvious way to redraw the line, depending onSELL_Lvl?
if(SELL_Lvl>0) { ObjectCreate("Sell no loss level", OBJ_HLINE, 0, 0, SELL_NoLossLevel); }
Then I need to increase SELL_Lvl to be redrawn:
ObjectDelete( "Sell no loss level");
But since theSELL_L_Lvl>0 condition is fulfilled, the line should be redrawn again, but at a new value ofSELL_NoLossLevel. Is there an easier and more obvious way to redraw the line, depending on the value ofSELL_Lvl?
Transfer the object to the new value without deleting it or re-creating it:
ObjectSetDouble(chart_ID, "Sell no loss level", OBJPROP_PRICE1, NewPrice);
Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Write down the condition for line redrawing clearly, with real price values, and then you will understand what you need to do.
On the highlighted: changed by how much? What indicates the fact that SELL_Lvl has changed?
SELL_Lvl is the number of knees (orders) of the sell grid.SELL_NoLossLevel is the total level (price) of the Buy order. Well, the idea is the following: we need a line drawn at the level of a Buy Line and redrawn respectively when new Lines are opened. I do not know how to do it.
TYRBO: I know how to find the price of a minimum order. I would appreciate if you could tell me how to find a minimum order ticket.
There is an example in the documentation.
It would probably be better to go through the orders in the loop and, provided that the next order is lower than the previous one, select it for further work with it. Thus, when we exit the loop, the order to be deleted will be selected.
Or you can first save its position in the order list in the loop and after the exit from the loop select it by the saved index.
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.
there is a variable
int Level = 0;
While the program is running, it is constantly changing. Help me write a condition: if Level has NOT changed, then do nothing. If Level has changed (no matter if it has changed up or down), then do some action { operator }
enter another variable
int Level1 = 0;
int Level = 0;
if (Level !=Level1)
{};
and then Level1 =Level
but I really don't understand why we need to pull an array on every tick if we can do it after any trade operation
enter another variable
int Level1 = 0;
int Level = 0;
if (Level !=Level1)
{};
and then Level1 =Level
I don't really understand why I need to pull an array at every tick, if I can do it after any trade operation
{
ObjectCreate("Sell no loss level", OBJ_HLINE, 0, 0, SELL_NoLossLevel);
}
Further, I need it to happen when SELL_Lvl increases:
But, since theSELL_Lvl>0 condition is fulfilled, the line is redrawn again, but by a new value ofSELL_NoLossLevel. Is there an easier and more obvious way to redraw the line, depending onSELL_Lvl?
{
ObjectCreate("Sell no loss level", OBJ_HLINE, 0, 0, SELL_NoLossLevel);
}
Then I need to increase SELL_Lvl to be redrawn:
But since theSELL_L_Lvl>0 condition is fulfilled, the line should be redrawn again, but at a new value ofSELL_NoLossLevel. Is there an easier and more obvious way to redraw the line, depending on the value ofSELL_Lvl?
Transfer the object to the new value without deleting it or re-creating it:
Transfer the object to the new value without deleting it or re-creating it:
This is certainly an option, but I would like the line to be redrawn by value ofSELL_NoLossLevel depending on whetherSELL_Lvlhas changed
like this if(ObjectGet("Sell no loss level", 1) !=SELL_NoLossLevel{ObjectDelete("Sell no loss level");}
The line is redrawn at every tick while I need it to be redrawn only ifSELL_Lvl changes
Of course it is a variant, but I would like the line to be redrawn bySELL_NoLossLevel depending on ifSELL_Lvl has changed
like this if(ObjectGet("Sell no loss level", 1) !=SELL_NoLossLevel{ObjectDelete("Sell no loss level");}
The line is redrawn on every tick, while I need it to be redrawn only ifSELL_Lvl changes
Explain the condition of line redrawing clearly, with real price values.
For the highlighted line: how much did it change? What indicates the fact that SELL_Lvl has changed?
i want to know what function to use to close a pending order in mcl5.
It is better to loop through, determine the right one and by documentation
Delete Pending Order
Trade order to delete a pending order. Requires 2 fields to be specified:
Better to cycle through, identify the right one and follow the documentation
Write down the condition for line redrawing clearly, with real price values, and then you will understand what you need to do.
On the highlighted: changed by how much? What indicates the fact that SELL_Lvl has changed?
I know how to find the price of a minimum order. I would appreciate if you could tell me how to find a minimum order ticket.
There is an example in the documentation.
It would probably be better to go through the orders in the loop and, provided that the next order is lower than the previous one, select it for further work with it. Thus, when we exit the loop, the order to be deleted will be selected.
Or you can first save its position in the order list in the loop and after the exit from the loop select it by the saved index.