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

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
What's wrong?
There is a template class
Then in the code I try to make it like this:
It frowns!
Then I try to do this in the code:
It frowns!
I need it like this:
here's an example of how to work with templates postedat https://www.mql5.com/ru/forum/221917/page25#comment_11205772
see if you can use my code as an analogy to yours
it has to be like this:
here's an example of how to work with the templates I postedhttps://www.mql5.com/ru/forum/221917/page25#comment_11205772
See if you can use my code to write yours
Thank you
is it possible to set the position of the text relative to the line ?
The line is created programmatically, the text is drawn above the line, but in some cases I need the text to be at the bottom...
how to do this ?
I would like to make it so that when opening a buy trade the advisor compares the trading lot of the opened trade with the maximum trading lot and if the lot is above a certain value the advisor automatically closes the last trade.
in the example below I indicated that the advisor closes trades if the trading lot is above 2... How do you think this condition will work?
if ((typeLastOrder==OP_BUY && orderlots()>2 || typeLastOrder==OP_BUYSTOP && orderlots()>2 || typeLastOrder==OP_BUYLIMIT && orderlots()>2)){
Alert("no lot higher than 2 is allowed");
CloseDelete(lastTicket);
return;
}
Afternoon,
I would like the Expert Advisor to compare the trade volume of the opened trade with the maximum trade volume, and if the volume is higher than a certain value, the Expert Advisor will automatically close the last trade.
In the example below, I have specified that the Expert Advisor should close trades if the trading lot is higher than 2. How do you think this condition will work?
if ((typeLastOrder==OP_BUY && orderlots()>2 || typeLastOrder==OP_BUYSTOP && orderlots()>2 || typeLastOrder==OP_BUYLIMIT && orderlots()>2)){
Alert("lot higher than 2 may not be used");
CloseDelete(lastTicket);
return;
}
And why should I open and then close it right away? Maybe it's better not to open at all?
Why open first and then close immediately? Wouldn't it be better not to open at all?
To control your greed
Help shift left, right or horizontally the tick numbers on top of the candles as red, green, yellow are rare. These numbers move vertically, but I can't do it horizontally. I want them to be in front of the candle to which they belong. The code of indicator:
//+------------------------------------------------------------------+
Help move left, right or horizontally the tick numbers on top of the candles as red, green, yellow are rare. These numbers move vertically, but I can't do it horizontally. I want them to be in front of the candle to which they belong. The code of indicator:
Help shift left, right or horizontally the tick numbers on top of the candles as red, green, yellow are rare. These numbers move vertically, but I can't do it horizontally. I want them to be in front of the candle to which they belong. The code of indicator:
Try toset the anchor point for theOBJ_TEXT objectin the
ANCHOR_CENTER
The anchor point is strictly in the object centre