Hello, Can you advise if anyone has encountered this problem: In the currency chart window, sometimes the chart itself disappears. Then it says refresh and everything is restored. At this time, sometimes expert advisors start working incorrectly (opening deals without conditions). Today even opened a trade with maximum lot. I have noticed it and closed with 2.5 points loss. Here is the code for determining the lot. I think this should not be so. I suspect that this is because of the last two lines. But how?
//======================================================================== //определение лота//========================================================================double Free =AccountFreeMargin();
double One_Lot =MarketInfo(Symbol(),MODE_MARGINREQUIRED);
double Step =MarketInfo(Symbol(),MODE_LOTSTEP);
double Min_Lot =MarketInfo(Symbol(),MODE_MINLOT);
double Max_Lot =MarketInfo(Symbol(),MODE_MAXLOT);
LOT=NormalizeDouble(AccountFreeMargin()*RISK/100000,2);
if (LOT*One_Lot > Free) // Не хватает даже..
{ // ..на минимальн. лот:(Comment("денег нет " );
return(0); // ..и выход
}
elseComment("деньга есть " );
if(LOT<Min_Lot)
LOT=Min_Lot;
if(LOT>Max_Lot)
LOT=Max_Lot;
далее открытие ордера по условиям.
Uses array string Mass_Name_Message[10] declared at global level. This is an array for storing object names. You can change its size to suit your needs. The Prefix variable stores names of experts to allow them to identify their own objects for correct handling of graphical objects. It is also declared globally and has the string type. You can probably figure it out...
It trims a long message, for example if you try to comment on the line "Check your EA settings, to open the settings window press F7".
it just leaves this: "Check your EA settings to open the settings window" and then it is cut off, although the text is not even halfway down the window.
Can you please tell me if there is any way to remove this restriction?
It trims a long message, for example if you try to comment on the line "Check your EA settings, to open the settings window press F7".
it just leaves this: "Check your EA settings to open the settings window" and then it is cut off, although the text is not even halfway down the window.
Can you please tell me if there is any way to remove this restriction?
Try my function. It is above your post on this page. Split a string into several strings so that each string is no more than 64 characters long. My function outputs these split lines one above the other. Then, when the next message is displayed, it grayscales the old ones above, and displays the new message in the colour you set when you called my function.
I downloaded the history and accidentally found out that I have a hole in USDJPY from 2012.01.16 to 2012.03.20. When I tried to re-download it, the terminal replied that I have the entire history. How can I fill this gap? How can I upload the history without any holes? And is there any way to check if there is a hole in the history?
artmedia70: Try my function. It is above your post on this page. Split a string into several strings so that each string is no more than 64 characters long. My function outputs these split lines one above the other. Then, when the next message is displayed, it grayscales the old ones above, and displays the new message in the colour you set when you called my function.
Thanks, but it's a bit complicated for me, and your function outputs 4 messages at once, while I need one. It turns out no more than 64 characters in one line?
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.
Roll, thanks for the tip, here's a feature to display a comment in the bottom left hand corner of the chart if anyone needs it:
void mycomment(color c,string mytext)
{
string name="mycomment";
if(ObjectFind(name)<0) ObjectCreate(name,OBJ_LABEL,0,0,0);
ObjectSet("mycomment", OBJPROP_CORNER, 2);
ObjectSet(name,OBJPROP_XDISTANCE,5);
ObjectSet(name,OBJPROP_YDISTANCE,7);
ObjectSetText(name,mytext,12,"",c);
}
Hi all!
Can you tell me if it's possible to display text on a graph, like
output as a separate function so it can be called like this:
Look at this function:
It looks for empty Win_Inform indicator window on the chart and, if it is present, displays messages in it. If not, outputs it with print.
Example call:
Uses array string Mass_Name_Message[10] declared at global level. This is an array for storing object names. You can change its size to suit your needs. The Prefix variable stores names of experts to allow them to identify their own objects for correct handling of graphical objects. It is also declared globally and has the string type. You can probably figure it out...
Turkey in a trailer
Faced with a small problem with my function:
void mycomment(color c,string mytext)
{
string name="mycomment";
if(ObjectFind(name)<0) ObjectCreate(name,OBJ_LABEL,0,0,0);
ObjectSet("mycomment", OBJPROP_CORNER, 2);
ObjectSet(name,OBJPROP_XDISTANCE,5);
ObjectSet(name,OBJPROP_YDISTANCE,7);
ObjectSetText(name,mytext,12,"",c);
}
It trims a long message, for example if you try to comment on the line "Check your EA settings, to open the settings window press F7".
it just leaves this: "Check your EA settings to open the settings window" and then it is cut off, although the text is not even halfway down the window.
Can you please tell me if there is any way to remove this restriction?
No, maximum line length in label = 62 characters.
Format the text into multiple lines (labels), or use Comment() - there are 255 characters
Below is the code itself.
If you have a simpler solution, I would be glad to receive comments.
Faced with a small problem with my function:
void mycomment(color c,string mytext)
{
string name="mycomment";
if(ObjectFind(name)<0) ObjectCreate(name,OBJ_LABEL,0,0,0);
ObjectSet("mycomment", OBJPROP_CORNER, 2);
ObjectSet(name,OBJPROP_XDISTANCE,5);
ObjectSet(name,OBJPROP_YDISTANCE,7);
ObjectSetText(name,mytext,12,"",c);
}
It trims a long message, for example if you try to comment on the line "Check your EA settings, to open the settings window press F7".
it just leaves this: "Check your EA settings to open the settings window" and then it is cut off, although the text is not even halfway down the window.
Can you please tell me if there is any way to remove this restriction?
How can I fill this gap?
How can I upload the history without any holes?
And is there any way to check if there is a hole in the history?
Try my function. It is above your post on this page. Split a string into several strings so that each string is no more than 64 characters long. My function outputs these split lines one above the other. Then, when the next message is displayed, it grayscales the old ones above, and displays the new message in the colour you set when you called my function.