Errors, bugs, questions - page 245

 

Does history bounce by any chance?

Is it always only on one symbol or is it also on GBPUSD?

What build? What server?

 

History bouncing is a thing of the past,

No on all currency pairs on simbol1 as well as on simbol2,

Bild 370, demo account (alpari-demo)


I would like to notice that I have only one trader (from the screenshot above) the overshoot is

I would like to notice that if I leave one indicator (on the above screenshot), the re-draw goes not so noticeable,

it may re-draw several times.

I thought the computer might be slow, but it is the same on a 2-core computer and the chart does not scroll

Probably, it is waiting for the idle time or something else?

In the evening on the six nuclei will test!

I also want to point out that nothing happened with the other similar turkeys.

It can't be because of complicated calculations! And the turntable is simple

and it works at Open prices.

 
alexluek:

Help! The indicator works fine, displays and calculates everything, but

when a new tick comes, it resets and the lines are re-calculated.

I have this happening regularly with loss of connection. After reconnection terminal recalculates indicator values, recalculation takes time. From Reference:

The relationship between the value returned by OnCalculate() and the second input parameter prev_calculated should be noted. The parameter prev_calculated when the function is called contains the value returned by OnCalculate() on the previous call. This allows for economical algorithms for calculating the custom indicator in order to avoid repeated calculations for those bars that haven't changed since the previous call of this function.

For this, it is usually enough to return the value of the rates_total parameter, which contains the number of bars in the current function call. If since the last call of OnCalculate() price data have changed (a deeper history has been pumped or history blanks have been filled), then the value of the input parameter prev_calculated will be set to zero by the terminal.

I do not know what exactly is your situation, but for myself I explain such behaviour as "filling of gaps in the history". Or maybe your indicator works inefficiently, recalculating the whole range of values at each arrival of a tick?

 

There was no loss of communication, overdrawing on ticks, and the bigger the TF the rarer.

And the method of calculation from start date to end date (I found out that there are 3 of them) without

Probably it happens (it recalculates all the bars), but it is not yet accurate and I don't know how to check it.

but it's just a thought - let's check it...

Maybe there is another approach to get rid of it...

 
alexluek:

There was no loss of communication, overdrawing on ticks, and the bigger the TF the rarer.

And the method of calculation from start date to end date (I found out that there are 3 of them) without

Probably it happens (it recalculates all the bars), but it is not yet accurate and I don't know how to check it.

but it's just a thought - let's check it...

Maybe there is another approach to get rid of it...

Of course, there is an approach. If(prev_calculated==0), we perform initial calculation for all bars. Subsequently, for each new tick (if 0 < prev_calculated < rates_total) we do calculations like for(int i=prev_calculated-1;i<rates_total;i++) only for last appeared bars.
 
Yedelkin:
Of course, there is an approach. If(prev_calculated==0), we perform initial calculation for all bars. Later, for each new tick (if 0 < prev_calculated < rates_total) we perform calculations of the type for(int i=prev_calculated-1;i<rates_total;i++) only for last appeared bars.
Good idea - let's try it and answer! Thank you!
 

I want to get the timeframe value of the current chart as a string. I'm writing it like this:

ENUM_TIMEFRAMES period1=Period();
string periodStr;
periodStr=PeriodStr(period1);

The compiler tells me that 'PeriodStr' - the function is not defined...

What's the point? Colleagues, please help :-)

There is such a function in the Help:

PeriodStr

Converts value of enumeration ENUM_TIMEFRAMES to string.

stringPeriodStr(
int val// value
)

Документация по MQL5: Основы языка / Типы данных / Целые типы / Перечисления
Документация по MQL5: Основы языка / Типы данных / Целые типы / Перечисления
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Перечисления - Документация по MQL5
 

Dear developers, please tell me what ambiguous call to an overloaded function is (this is what the compiler is swearing about):

'set' - ambiguous call to overloaded function

class CA
  {
public:
   void set(int i,int j,long n){Print("перегрузка long");};
   void set(int i,int j,int n){Print("перегрузка int");};
  };

void OnStart()
  {
//---
   CA a;
   int Int=3;
   long Long=4;
   a.set(1,2,Int);
   a.set(1,2,Long);
  }

HH I figured out the way that if you replace the constants in the first and second parameter to the variable type int, then the swearing stops.

But I do not understand the logic of the compiler, the first two parameters are the same in all overloads, no default parameters.

So why does the compiler swear, what is the ambiguity of the call?

Документация по MQL5: Основы языка / Типы данных / Целые типы / Типы char, short, int и long
Документация по MQL5: Основы языка / Типы данных / Целые типы / Типы char, short, int и long
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Типы char, short, int и long - Документация по MQL5
 
denkir:

I want to get the timeframe value of the current chart as a string. I'm writing it like this:

The compiler tells me that 'PeriodStr' - the function is not defined...

What's the matter? Colleagues, please help me :-)

You see, the Help file has this function:

PeriodStr

Converts enumeration value of ENUM_TIMEFRAMES into string.

stringPeriodStr(
int val// value
)

Strange, I did not find such a function - PeriodStr - in the handbook
 
denkir:

I want to get the timeframe value of the current chart as a string. I'm writing it like this:

The compiler tells me that 'PeriodStr' - the function is not defined...

What's the problem? Colleagues, please help me :-)

There is such a function in the Help:

PeriodStr

Converts value of enumeration ENUM_TIMEFRAMES to string.

stringPeriodStr(
int val// value
)

This is a Class method

https://www.mql5.com/ru/docs/standardlibrary/technicalindicators/cindicator

#include<Indicators\Indicator.mqh>