Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 976

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
Yes this function of course I know, I mean - a tab in the window of the terminal, (trade, assets, account history, news, alerts, mail, etc.) when the mail comes there (in the internal mail terminal) sent an SMS or e-mail (eg to receive messages about restarting the server, etc.)?
So phrase the question as you think about it.
If you are thinking clearly, you are thinking clearly...
Hello. I can't understand what my mistake is, or rather what is the flaw in this block in my program:
//---Separate accounting of open orders
for(int i=OrdersTotal()-1;i>=0;i--)//OrdersTotal()-1;i>=0;i-- //Loop of orders
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);// If an order is found, then:
{
if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=Magic) continue;
}
{
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
if(OrderType()==OP_BUY)
Total++;
}
return;
}
//---
for(int i=OrdersTotal()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
{
if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=Magic) continue;
}
{
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
if(OrderType()==OP_SELL)
Total++;
}
return;
}
//---
The EA stably works in the Strategy Tester and on a demo account, but when compiling it generates 2 warnings: return value of 'OrderSelect' shuld be checked, which I cannot get over. If it's possible, please tell me what I wrote wrong or incomplete.
Hello. I can't understand what my mistake is, or rather what is the flaw in this block in my program:
//---Separate accounting of open orders
for(int i=OrdersTotal()-1;i>=0;i--)//OrdersTotal()-1;i>=0;i-- //Loop of orders
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);// If an order is found, then:
{
if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=Magic) continue;
}
{
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
if(OrderType()==OP_BUY)
Total++;
}
return;
}
//---
for(int i=OrdersTotal()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
{
if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=Magic) continue;
}
{
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
if(OrderType()==OP_SELL)
Total++;
}
return;
}
//---
The EA stably works in the Strategy Tester and on a demo account, but when compiling it displays a warning: return value of 'OrderSelect' shuld be checked, which I cannot overcome in any way. If it's possible, please tell me what I wrote wrong or incomplete.
Hello. I can't understand what my mistake is, or rather the deficiency of this block in my program:
...1) To paste the code correctly here, click on SRC and then copy your code in the box (picture below).
2) Try this code:
How can I get alert
Alert(OrderOpenPrice());
displaythe opening price of the order with 5 decimal places? NormalizeDouble(OrderOpenPrice(),Digits) doesn't help.(The order is pre-selected).
How can I get alert
display the opening price of the order with 5 decimal places? NormalizeDouble(OrderOpenPrice(),Digits) doesn't help.(The order is pre-selected).
Hello dear!
Please help translate the algorithm for finding the coordinates of the intersection point of two segments
From the article:
It's very simple!
x1,y1 and x2,y2 are coordinates of vertices of the first segment;
x3,y3 and x4,y4 are coordinates of the vertices of the second segment;
to find the intersection we make the equations of the lines:
first equation:
(x-x1)/(x2-x1)=(y-y1)/(y2-y1);
second equation
(x-x3)/(x4-x3)=(y-y3)/(y4-y3);
these equations define a line passing through two points, which is what we need.
From these equations we find x and y by the following formulas:
x:=((x1*y2-x2*y1)*(x4-x3)-(x3*y4-x4*y3)*(x2-x1))/((y1-y2)*(x4-x3)-(y3-y4)*(x2-x1));
y:=((y3-y4)*x-(x3*y4-x4*y3))/(x4-x3);
since our lines intersect, they have a common intersection point with the coordinates (x,y), which we need to find.
For the intersection to belong to our line segments, we need to constrain it, i.e. check the condition:
if
(((x1<=x)and(x2>=x)and(x3<=x)and(x4 >=x))or((y1<=y)and(y2>=y)and(y3<=y) and(y4>=y))
then there is an intersection point of these segments, and if there is not, there is no intersection point.
You should also check the parallelism of these segments using angle coefficients:
k1:=(x2-x1)/(y2-y1);
k2:=(x4-x3)/(y4-y3);
where k1 and k2 are tangents of the angle of slope of the segments to the positive direction of axis ОХ, if k1=k2, then the segments are parallel, so they don't have intersection points.
And maybe someone has a ready-made one in the archives?
Is there any possibility or function in MT4 to redirect messages to the internal terminal mail (about leverage change, server restart, etc.) by sms or e-mail
P.s a tab in terminal window, (trade, assets, account history, news, alerts, MESSAGE, etc.)?
See the help for functions, and the forum for examples of their use:
1. iHighest/iLowest
- to avoid confusion, these functions return an index corresponding to the maximum/minimum price.
Then you should put their values into High[] / Low[]. You will find a lot of examples on the forum.
2. iBarShift