Errors, bugs, questions - page 1777

 
Will the product pass automatic testing if it(the examiner) is looped in the code?
 
Alexandr Bryzgalov:
Will the product pass automatic testing if it(the examiner) is looped in the code?

Of course not. Firstly, cycles are not needed now, there is a timer. Secondly, it can always be uncycled for the tester.

 
Комбинатор:

Of course not. Firstly there is no need for cycles now, there is a timer. Secondly it can always be uncycled for the tester.

The timer doesn't go off more than once every 1 second if you're out of startup.

it's rare.

Or has there been a change?

 
Alexandr Bryzgalov:

the timer does not trigger more than once every 1 sec if you got out of the start.

is rare.

or has there been an innovation?

for a long time there has been a micro timer that goes off once every 1ms

But now the timer in mt4 is in trouble, it stops working for some reason. No one knows the answer"WHY"

 
Vladislav Andruschenko:

for a long time there is a micro timer that goes off once every 1 ms.

But now the timer in mt4 is in trouble, it stops working for some reason. No one knows the answer"WHY".

It doesn't work in general.
 
Alexandr Bryzgalov:
in general does not work.

now basically any timer - on some terminals it doesn't work, even the administration doesn't know why.

But there is some speculation - the internet hangs up and the timer itself "hangs up".

 
Vladislav Andruschenko:

But now the stammer in mt4 is in trouble, it stops working for some reason. No one knows the answer"WHY".

I think restarting the terminal or recompiling might help, but the bug is BREAKING.
 
Комбинатор:
It seems that restarting the terminal or recompiling can help.

Yes, but you can't explain that to customers, can you?

Imagine that the expert is working, it works, you go to sleep, you go to sleep, you wake up and the expert is not working, why? Because the timer hangs up, and what to do, who is to blame?

 
Vladislav Andruschenko:

Yeah, but you can't explain that to the customers, can you?
That's the thing.
 
Alexey Kozitsyn:

Thank you, please check the number of the first visible bar on the chart: ChartGetInteger( 0, CHART_FIRST_VISIBLE_BAR );

The point is that if you disable chart scrolling and monitor the last visible bar, then at the moment of a new candle its number changes for some reason, although the chart does not move! The TF is M1 in order to be able to check faster. Running from the indicator:

#property indicator_chart_window
#property indicator_plots 0
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
   {
    //--- Подписываемся на событие движения мыши
         ChartSetInteger( 0, CHART_EVENT_MOUSE_MOVE, true );
         //---
    return(INIT_SUCCEEDED);
   }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
   {

    return(rates_total);
   }
//+------------------------------------------------------------------+
//| Обработка события графика                                        |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
   {
    switch( id )        
        {
         case CHARTEVENT_MOUSE_MOVE:
                 Print( __FUNCTION__," "+TimeToString( TimeCurrent(), TIME_DATE|TIME_SECONDS )+": sparam = "+sparam+", ",(int)ChartGetInteger( 0, CHART_FIRST_VISIBLE_BAR ));
                 break;
        }
   }


Afternoon!

This is standard behaviour. The countdown starts from the current bar which is under construction. Accordingly, when a new bar appears, if there is no autoscrolling, its number is increased by one.
Reason: