Thanks for the help, it is starting to make sense, but only at the beginning of a new day are the values reset, and we need it to stay until the next series of orders to be closed in one day
I change the parameters on the panel (which is on the graph), but they don't change in the Expert Advisor. Sadness.
If you don't want to create duplicated instances and further use them in the program, you can always set user parameters as "extern" - their values can be changed programmatically in the process of work.
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.
For two days, I've been making a nice panel. But it turned out that I could not change the Expert Advisor parameters set as inputs through it.
What do I do now?
no imagination at all?
input double _PARAM=1.0; // да, input менять в коде нельзя, они типа const
double PARAM=0; // но никто не заставляет использовать только и исключительно их
int OnInit()
{
if (MoonPhaze()==0 && _PARAM>0.1) {
PARAM=_PARAM; // всё что задаёт пользователь через input должно проверяться и использоваться только внутри OnInit - это просто хороший тон
}
}I seem to be misunderstood.
I change the parameters on the panel (which is on the graph), but they don't change in the Expert Advisor. Sadness, sadness.
Please help me, I am completely confused in writing this function
I need the function to return the number of orders closed in one day
I would write it like this:
Please help me, I am completely confused in writing this function
I need the function to return the number of orders closed in one day
int OrdersClosedInDay(datetime time) {
datetime from=time-TimeHour(time)*60*60-TimeMinutes(time)*60-TimeSeconds(time);
datetime to=from+24*60*60;
int count=0;
for(int pos=OrdersHistoryTotal()-1;pos>=0;pos--) {
if (!OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY)) continue;
if (OrderCloseTime()>=from && OrderCloseTime()<to) count++;}
return count;
}
I would write it this way:
Thanks for the help, it is starting to make sense, but only at the beginning of a new day are the values reset, and we need it to stay until the next series of orders to be closed in one day
I figured it out and added another function
You can't draw objects. But you can draw using CCanvas class - you can there
I seem to be misunderstood.
I change the parameters on the panel (which is on the graph), but they don't change in the Expert Advisor. Sadness.
If you don't want to create duplicated instances and further use them in the program, you can always set user parameters as "extern" - their values can be changed programmatically in the process of work.
Please advise. How do I specify in the EA to close on the next candle?