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

 
Порт-моне тв Asian session prices. And it should be somehow calculated not point by point (because it will not be universal), but by each issuer's price deviation, and then a broken line of prices is formed and somehow it all adds up (their deviations).

Why this is needed: summary charts are very helpful in understanding a particular process, sector, industry, etc.

Get it from the internet or come up with a calculation formula and create a custom indicator based on it. What's the problem?

 
Mihail Matkovskij #:

Take a calculation formula from the internet or come up with one and create a custom indicator based on it. What is the problem?

"Get it from the internet" where?

 
Mihail Matkovskij #:

What's wrong with your code?

Here's what I got with this script

Thanks for the tip not one way or the other not without your help I solved this problem.

Thank you!!!

But most importantly I didn't understand why the bar shifts????

 
EVGENII SHELIPOV #:

Thanks for the tip not one way or the other not without your help I have solved this problem.

Thank you!!!

But most importantly I didn't understand why the bar shift happened????

Show me all the code... we'll look for a shift
 

Please help insert the pause function into the EA.

input bool   p          = false; // задействовать паузу или нет 
input string TimeStart  = "00:00"; // время старта паузы 
input string TimeEnd    = "00:00"; // конец паузы

//+------------------------------------------------------------------+

datetime StartPause,EndPause;

//+------------------------------------------------------------------+

StartPause = StrToTime(TimeStart);   EndPause   = StrToTime(TimeEnd);

//+------------------------------------------------------------------+

if((p && StartPause < EndPause && (TimeCurrent() > StartPause &&  TimeCurrent() < EndPause)))
{
            Comment("Пауза в работе советника");
            return;
}

if((p && StartPause > EndPause && (TimeCurrent() > StartPause ||  TimeCurrent() < EndPause)))
{
            Comment("Пауза в работе советника");
            return;
}
Files:
IM_Go.mq4  13 kb
 
Tretyakov Rostyslav #:
Show me all the code... we'll look for the shift.
ObjectSetText("signal34",DoubleToString(AccountLeverage(),0),18,"Times New Roman", clrRed);
   ObjectCreate(0,"Начало торговли",OBJ_VLINE, 0, Time[0] + PeriodSeconds(PERIOD_CURRENT) + (StartTime*3600), 0);

Here is the part of the code responsible for the vertical line on the graph. I've already accounted for the shift

 
EVGENII SHELIPOV #:

Here is the part of the code responsible for the vertical line on the graph. I've already taken the shift into account.

I need the code where the line is created

 
EVGENII SHELIPOV #:

Here is the part of the code responsible for the vertical line on the graph. I've already accounted for the shift.

Your original code is correct.

   Print(TimeToString(Time[0],TIME_MINUTES),"/",TimeToString(Time[0]+2*3600,TIME_MINUTES));
2022.01.05 15:39:36.660 Price_Time GBPJPY,M5: 15:35/17:35
 
EVGENII SHELIPOV #:

Thanks for the tip not one way or the other not without your help I have solved this problem.

Thank you!!!

But most importantly I didn't understand why the bar shifts????

Most likely there was some bug in the code. Compare the working version with the wrong one.

 
Порт-моне тв #:

"Get it from the internet" where?

Well, then you should have started with that question in the first place. Maybe someone knows how to do it. And only then should you think about how to write an indicator.

Reason: