Errors, bugs, questions - page 1005

 
ns_k:

Good afternoon!

Doindicator buffers save values between indicator runs or is there some glitch with my terminal?

I built an indicator, then I commented out the counting algorithm and pressed compile - all values remain on the chart. I think I may need to put the indicator on the chart again to update the buffer values; I put it with missing calculation cycle and it still has the same values. Had to restart the terminal to get rid of it.

Please comment on this.

Thank you!

It seems that there are still conditions that leave already calculated values in the buffers. I don't understand what exactly these conditions are. The problem is gone after restarting the terminal. In fact, that's why I wouldn't write a request to the service.

In general, maybe it's not a bug but a feature?

Thank you!

 
ns_k:

There do seem to be conditions under which the already calculated values remain in the buffers. What exactly are these conditions, I don't understand. After restarting the terminal, the problem disappeared. In fact, that's why I wouldn't write a request to the service.

In general, maybe it's not a bug but a feature?

Thank you!

Just reset the array values to zero before filling or during initialization:

ArrayInitialize(buffer_data,EMPTY_VALUE);
 
ns_k:

There do seem to be conditions under which the already calculated values remain in the buffers. What exactly are these conditions, I don't understand. After restarting the terminal, the problem disappeared. In fact, that's why I wouldn't write a request to the service.

In general, maybe it's not a bug but a feature?

Thank you!

The values need to be reset
 
tol64:

Before filling or during initialisation, simply reset the array values to zero:

Thank you!!!
 

It would be nice if the right-click context menu could have a separate item with custom indicators

Thank you!

Переход на новые рельсы: пользовательские индикаторы в MQL5
Переход на новые рельсы: пользовательские индикаторы в MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
Я не буду перечислять все новые возможности и особенности нового терминала и языка. Их действительно много, и некоторые новинки вполне достойны освещения в отдельной статье. Вы не увидите здесь кода, написанного по принципам объектно-ориентированного программирования — это слишком серьезная тема для того, чтобы просто быть упомянутой в контексте как дополнительная вкусность для кодописателей. В этой статье остановимся подробней на индикаторах, их строении, отображении, видах, а также особенностях их написания по сравнению с MQL4.
 

Another question please :)

What is the way to display comments in the indicator window rather than in the chart window?

Thank you!

 
ns_k:

How can the comments be displayed in the indicator window rather than in the chart window?

There is no provision for this behaviour. Use objects if you really need to.
 

Good afternoon!

It is better to make the indicator properties window non-modal,if possible.

Thank you!

 
ns_k:

Good afternoon!

It is better to make the indicator properties window non-modal,if possible.

Thank you!

And add an Apply button. In other words, we have changed the value, press the Apply button and we will see the changes without closing the window. It would be much more convenient.

And for the hundredth time - the possibility to change the size of the properties window.

P.S. Write more in Service Desk.

 

I don't know where I'm getting dumb, so to speak.

int OnCalculate (const int rates_total,      // size of input time series
                 const int prev_calculated,  // bars handled in previous call
                 const datetime& time[],     // Time
                 const double& open[],       // Open
                 const double& high[],       // High
                 const double& low[],        // Low
                 const double& close[],      // Close
                 const long& tick_volume[],  // Tick Volume
                 const long& volume[],       // Real Volume
                 const int& spread[]         // Spread
                 )

  {
   
   
   
   doDrawIndicator(gSymbols[0],rates_total,g1ThermB);


//Comment(rates_total);
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction &trans,
                        const MqlTradeRequest &request,
                        const MqlTradeResult &result)
  {
//---

  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int doDrawIndicator(string xSymbol, int xRatesTotal, double &xBuffer[])//,double &xPrice[],double &xBuffer[])
  {
   double l1Close[]; // , l2Close[];
   datetime lTime[];
   datetime lEnd,lStart;
   int copied;
   ArrayInitialize(xBuffer,0);
   lEnd=TimeCurrent();
   lStart=(TimeCurrent()/86400)*86400+3600;

   copied=CopyTime(xSymbol,Period(),lStart,lEnd,lTime);
   if(copied==-1){Print("Can't copy time",__FUNCSIG__);return(0);}
   copied=CopyClose(xSymbol,Period(),lStart,lEnd,l1Close);
   if(copied==-1){Print("Ждите...1");return(0);}

   sThermometer lT;
  // Print("rates_total=",rates_total);
   //Comment(xSymbol);
   Comment(copied);
   g1RM=new CRangeManager(1,0.2,20,xSymbol);
 
   for(int i=0;i<copied;i++)
     {
      lT=g1RM.getStateByValue(l1Close[copied-i-1]);
      if(gThermRange==Up && lT.cTemperature.State<7 || gThermRange==Down && lT.cTemperature.State>6 )
        {
         xBuffer[xRatesTotal-i-1]=lT.cTemperature.Temperature;
        }
      else
        {
         xBuffer[xRatesTotal-i-1]=0;
        }
     }

     
   delete g1RM;
   return(1);

  }

The indicator doesn't update, i.e. I keep seeing 739 say in the left corner (thrown on the minutiae as you understand). And as soon as I press compile, the indicator is updated. Where in the code is the error?

Thanks!

Reason: