Objects aren't shown? - page 3

 
Carl Schreiber #:
I have developed this indicator already some time ago. I have never had this problem neither during the coding and testing nor later except ... (see above).

I'd swear its ChartRedraw but its not . I built something similar (only difference is its plotting a line and not a histogram) and it displays properly

Even the template reports the same things 


#property version   "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot bobo
#property indicator_label1  "bobo"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         boboBuffer[];

string system_tag="CS_";
bool executed=false;
int mySubwindow=-1;
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,boboBuffer,INDICATOR_DATA);
   ObjectsDeleteAll(ChartID(),system_tag);
   IndicatorSetString(INDICATOR_SHORTNAME,"VOIDINDICATOR");
   mySubwindow=find_indicator_subwindow("VOIDINDICATOR");
   executed=false;
   if(mySubwindow==-1){return(INIT_FAILED);}
//---
   return(INIT_SUCCEEDED);
  }

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[])
  {
//---
  if(!executed&&rates_total>0){
  executed=true;
  for(int i=0;i<rates_total;i++){
     boboBuffer[i]=(high[i]-low[i])/1.618;
     }
  //line 
    ObjectCreate(ChartID(),system_tag+"_BOBO",OBJ_TREND,mySubwindow,time[rates_total-11],boboBuffer[rates_total-11],time[rates_total-2],boboBuffer[rates_total-2]);
    ObjectSetString(ChartID(),system_tag+"_BOBO",OBJPROP_TEXT,"Description");
  }
//--- return value of prev_calculated for next call
   return(rates_total);
  }

int find_indicator_subwindow(string name){
int windows=ChartGetInteger(ChartID(),CHART_WINDOWS_TOTAL);
for(int w=0;w<windows;w++){
int indys=ChartIndicatorsTotal(ChartID(),w);
for(int i=0;i<indys;i++){
if(ChartIndicatorName(ChartID(),w,i)==name){
return(w);
}}}
return(-1);
}
 

Both points belong to the same H1 bar

   datetime dt1 = 1677611250;
   datetime dt2 = 1677612600;
   Alert("1: ", dt1); // 2023.02.28 19:07:30
   Alert("2: ", dt2); // 2023.02.28 19:30:00

Will the problem persist if we move point 1 one bar to the left? 18:07:30 instead of 19:07:30

 
Carl Schreiber #:

Ok, I have saved a template of both terminals, with and without the objects and I picked the object dash03 as an example from both templates:

with objects on the chart:

and without objects on the chart:

I can't see any difference that should matter.

Both are created by the same (custom) indicator on different terminals and different brokers - I repeat myself.

Lorentzos asked you for code, I asked you for a template, to reproduce the issue. You provided none. It's either an MT5 bug or an issue on your side, the only way to know is to try to reproduce it, but you seem reluctant to provide what is needed.
 
Vladislav Boyko #:

Both points belong to the same H1 bar

Will the problem persist if we move point 1 one bar to the left? 18:07:30 instead of 19:07:30

Interesting observation . I think the time axis is not "stiff" in mt5 like in mt4 . 

I changed the code above to have "display offsets" and the line collapsed to one bar . 

So if he has one price point and one time point it is no longer a visible line.

Nice catch

and the dates remain different in the template 


#property version   "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot bobo
#property indicator_label1  "bobo"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
input int inset=900;
input int ofset=900;
//--- indicator buffers
double         boboBuffer[];

string system_tag="CS_";
bool executed=false;
int mySubwindow=-1;
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,boboBuffer,INDICATOR_DATA);
   ObjectsDeleteAll(ChartID(),system_tag);
   IndicatorSetString(INDICATOR_SHORTNAME,"VOIDINDICATOR");
   mySubwindow=find_indicator_subwindow("VOIDINDICATOR");
   executed=false;
   if(mySubwindow==-1){return(INIT_FAILED);}
//---
   return(INIT_SUCCEEDED);
  }

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[])
  {
//---
  if(!executed&&rates_total>0){
  executed=true;
  for(int i=0;i<rates_total;i++){
     boboBuffer[i]=(high[i]-low[i])/1.618;
     }
  //line 
    ObjectCreate(ChartID(),system_tag+"_BOBO",OBJ_TREND,mySubwindow,time[rates_total-2]+inset,boboBuffer[rates_total-11],time[rates_total-1]-ofset,boboBuffer[rates_total-2]);
    ObjectSetString(ChartID(),system_tag+"_BOBO",OBJPROP_TEXT,"Description");
  }
//--- return value of prev_calculated for next call
   return(rates_total);
  }

int find_indicator_subwindow(string name){
int windows=ChartGetInteger(ChartID(),CHART_WINDOWS_TOTAL);
for(int w=0;w<windows;w++){
int indys=ChartIndicatorsTotal(ChartID(),w);
for(int i=0;i<indys;i++){
if(ChartIndicatorName(ChartID(),w,i)==name){
return(w);
}}}
return(-1);
}
 
Alain Verleyen #:
Lorentzos asked you for code, I asked you for a template, to reproduce the issue. You provided none. It's either an MT5 bug or an issue on your side, the only way to know is to try to reproduce it, but you seem reluctant to provide what is needed.

If it were a problem of my code it would appear not only on both terminals but also when I was developing this indicator - no?

Next weekend I'll update the MT5 and then we'll see - I'll let you know.

 
Carl Schreiber #:

If it were a problem of my code it would appear not only on both terminals but also when I was developing this indicator - no?

When investigating a software issue you need to be open minded, don't draw any conclusion before checking all possibilities. Some bugs only trigger on very specific conditions. The only way to know for sure is to reproduce it.

 
Carl Schreiber #: If it were a problem of my code it would appear not only on both terminals but also when I was developing this indicator - no?

Not necessarily, I can think of one possibility.

You were asked to provide both templates. You have failed to do so; a snip it may not show the problem.
          Be precise and informative about your problem

 
Lorentzos Roussos #:

Interesting observation . I think the time axis is not "stiff" in mt5 like in mt4

I think so too. Therefore, I suggested making a copy of the indicator, in which to do this:

dt1 -= PeriodSeconds(); // First point (left)

If after that the problem persists, then we can say with great certainty that the problem is not in the coordinates.

Just localization

 
Vladislav Boyko #:

I think so too. Therefore, I suggested making a copy of the indicator, in which to do this:

If after that the problem persists, then we can say with great certainty that the problem is not in the coordinates.

Just localization

Yeah , you probably found the issue .

 
Vladislav Boyko #:

I think so too. Therefore, I suggested making a copy of the indicator, in which to do this:

If after that the problem persists, then we can say with great certainty that the problem is not in the coordinates.

Just localization

Lorentzos Roussos #:

Yeah , you probably found the issue .

Then that means the "Precise time scale" is not set in his 3550 platform.


Reason: