Please advise, how to store in a variable which expression happens to be true? To be more precise - what is the minimum calculated in the function with respect to a candle of what timeframe? How to save the identifier of this timeframe in a variable? Thank you
Good afternoon! Can you tell me how to bind text to a line in mql4, so that when the latter is moved, the inscription is also shifted, like in the screenshots. I know that there are two ways to bind an object: in pixels to the corner of the screen and in time/price coordinates. In the first case, I get a static text, and in the second, it's not quite what I want. With the price coordinate (vertical binding) is clear - I take the line price and add a _Point pair to it, so the text would be a bit higher than the line. But what about time? I do not want to bind to the last bar because different shift of the chart will pull the text to the right - to the left. Here I would like to make a rigid horizontal binding to the right edge of the screen, but I do not understand how.
Oleksandr Nozemtsev: Good afternoon! Can you tell me how to bind text to a line in mql4, so that when the latter is moved, the inscription is also shifted, like in the screenshots. I know that there are two ways to bind an object: in pixels to the corner of the screen and in time/price coordinates. In the first case, I get a static text, and in the second case, it's not quite what I want. With the price coordinate (vertical binding) is clear - I take the line price and add a _Point pair to it, so the text would be a bit higher than the line. But what about time? I do not want to bind to the last bar because different shift of the chart will pull the text to the right - to the left. Here I would like to make a rigid horizontal binding to the right edge of the screen, but I do not understand how.
MakarFX: Do you draw the lines yourself or the indicator?
The line is created by the indicator when it is loaded. The text is needed to show information about this level directly above the line, rather than displaying it in Alert (Alert works).
The line is created by the indicator when it is loaded. Text is needed to show information about this level directly above the line, rather than displaying it in Alert (Alert works).
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.
Thank you for the valuable information.
Please advise, how to store in a variable which expression happens to be true? To be more precise - what is the minimum calculated in the function with respect to a candle of what timeframe? How to save the identifier of this timeframe in a variable?
Thank you
Just declare bool variables
Just declare bool variables
Thank you for the useful information.
Could you please tell me how to save a 5 digit value in yellow variable if the test is done on a minute chart
Thank you.
Good afternoon! Can you tell me how to bind text to a line in mql4, so that when the latter is moved, the inscription is also shifted, like in the screenshots. I know that there are two ways to bind an object : in pixels to the corner of the screen and in time/price coordinates. In the first case, I get a static text, and in the second case, it's not quite what I want. With the price coordinate (vertical binding) is clear - I take the line price and add a _Point pair to it, so the text would be a bit higher than the line. But what about time? I do not want to bind to the last bar because different shift of the chart will pull the text to the right - to the left. Here I would like to make a rigid horizontal binding to the right edge of the screen, but I do not understand how.
Do you draw the lines yourself or the indicator?
The line is created by the indicator when it is loaded. The text is needed to show information about this level directly above the line, rather than displaying it in Alert (Alert works).
The line is created by the indicator when it is loaded. Text is needed to show information about this level directly above the line, rather than displaying it in Alert (Alert works).
Post the line creation code
int OnInit()
{
//Create line "name_line" if it does not exist yet
if(ObjectFind(0, name_line) == -1)
{
//If price is not specified, set it to the current Ask price
if(!price_line)
price_line = SymbolInfoDouble(Symbol(), SYMBOL_ASK);
//reset error value
ResetLastError();
//create a line
if(!ObjectCreate(0, name_line, OBJ_HLINE, 0, 0, price_line))
Print("Line Line. Error ", GetLastError());
//
ObjectSet(name_line, OBJPROP_COLOR, color_line); //Line colour
ObjectSet(name_line, OBJPROP_STYLE, style_line); //Line style
ObjectSet(name_line, OBJPROP_WIDTH, width_line); //line thickness
ObjectSet(name_line, OBJPROP_BACK, back_line); //Front/back
ObjectSet(name_line, OBJPROP_SELECTABLE, selection_line);//The object can be clicked with the mouse.
ObjectSet(name_line, OBJPROP_SELECTED, selection_line); //The object is selected. O is not selected at creation
}
return(INIT_SUCCEEDED);
}
Catch
Catch
Wow, that's a lot! I thought it was just a couple of lines of code. Thank you! (laughs)
Just declare bool variables
Could you please also tell me how to save a 5 digit blue value in a yellow variable if the test takes place on a 1 minute chart
Thank you