Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 109

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all.
Who can see why it displays like this?
I.e. the functions are different properties but the display is the same.
Also with two other objects of the same type, only one of them works, the other parameters are ignored
And look at what name the lines are created with, and what name is used to move and delete them.
And why not pass parameters to functions at the time they are called?
And look at what name lines are created, and what name is used to move and delete them.
And why not pass parameters to functions at the time they are called?
I do not understand how it is, I fixed the names, the line still goes red regardless of the order type, it is just called differently. (Then I have to find a way to cut it to 10 bars)
A straight line segment can only be drawn with a trend line (OBJ_TREND or OBJ_TRENDBYANGLE). The horizontal and vertical lines are not cut.
What kind of conditions are these?
if(!price1)
price1=FindLastOrderOpenPrice();
..............
if(!price2)
price2=FindLastOrderOpenPrice();
What do you want them to do?
And you have to read the log, what does it say?need to change the display of the indicator (change the thin lines to dotted lines)
like this:
it needs to be like this:
please tell me how to do it?
Hi all
need to change the display of the indicator (change the thin lines to dotted lines)
like this:
it needs to be like this:
please tell me how to do it?
If the price is zero or is not set, set the line coordinate to the price of the last order. This is fine.
The log is also normal, it drains the account as it should be. I do not watch errors about insufficient deposit.
But the line is still red. I.e. we call the buy line, it is as it is, we pass the parameters, but other parameters are passed.
Try it this way:
if (ObjectFind(0,"Rectangle 33579")<0) Alert("НЕТ");
else Alert("ДА");
Please help me to write a function that will calculate the number of orders and their total profit closed in the last 60 seconds on the current pair. I can't find it on my tongue, I can't formulate it correctly.
double ClosingSellProfit=0, ClosingBuyProfit;
for(int i=0; i<OrdersHistoryTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) && OrderSymbol()==Symbol())
{
if(OrderType()==OP_SELL)
{
if(. . .)
{
CountClosedSellOrders++;
ClosingSellProfit+=OrderProfit()+OrderCommission()+OrderSwap();
}
if(OrderType()==OP_BUY)
{
if(. . .)
{
CountClosedBuyOrders++;
ClosingBuyProfit+=OrderProfit()+OrderCommission()+OrderSwap();
}
}
}
}
Try it this way:
else Alert("ДА");