Renko Time

 

Hi all, I would like to create an histogram indicator to track the time for every Renko brick.

I wrote this but I seem it doesn't work well, could you help me? Thank you!

int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   
//---- last counted bar will be recounted
 
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   
//---- calcolo entry_long 
   for(int i=1; i<limit; i++)
      Histogram[i] = Time[i] - Time[i+1] ;
 
   Histogram[0] = TimeCurrent() - Time[0] ;
    return(0);
//---- done
   
  }
 
I think  this indi does just that
Files:
 

Thank you very much!

Could you explain the Threshold ?

 
  1. Alberto Tortella: but I seem it doesn't work well,

    "Work well" or "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here and our crystal balls are cracked.

  2. Alberto Tortella: Could you explain the Threshold ?
    It draws a histogram if that bar's duration is at least that many minutes.
 
William Roeder:
  1. "Work well" or "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here and our crystal balls are cracked.

  2. It draws a histogram if that bar's duration is at least that many minutes.
1. I don't understand why you waste time with these rude answers. If you don't want to look at the code, it's enough that you don't answer, don't you think?


2. No, Threshold is to avoid to obtain too big histogram. The bars are drawn anyway.

 
Alberto Tortella:

Thank you very much!

Could you explain the Threshold ?

I am no coder, but threshold seems to be the maximum value in minutes that a renko bar can have in the histogram even if that renko bar lasts longer than the specified threshold. So if threshold is 1000, then renko bars that lasts longer than 1000 min will have value of 1000 in the histogram.

 
Alberto Tortella:
1. I don't understand why you waste time with these rude 
answers. If you don't want to look at the code, it's enough that you 
don't answer, don't you think?

2. No, Threshold is to avoid to obtain too big histogram. The bars are drawn anyway.

  1. You wrote "doesn't work well." How should we answer that? You couldn't even write a meaningful question. You waste everyone's time (not one person but possibly hundreds have looked at your post,) with your nonsense - how rude.
  2. My mistake, less than vs greater than. The coffee hadn't yet kicked in. But why did you ask "Could you explain the Threshold ?" when now you know the answer? You waste everyone's time, with an question you could have answered yourself and did - how rude.
 

I'm trying to recall the indicator with iCustom function, but in the period field I don't find "M2" choice.

Is it possible to recall off line periods?

 
Alberto Tortella:

I'm trying to recall the indicator with iCustom function, but in the period field I don't find "M2" choice.

Is it possible to recall off line periods?

Of course, you don't. There is no M2 in MT4. Do you have an off-line chart generator, createing it?
          Chart Timeframes - Chart Constants - Constants, Enumerations and Structures - MQL4 Reference
 
William Roeder:
Of course, you don't. There is no M2 in MT 4. Do you have an off-line chart generator, createing it?
          Chart Timeframes - Chart Constants - Constants, Enumerations and Structures - MQL4 Reference

Yes, I have it and I'm applying the custom indicator on.

So it's not possibile to read a custom indicator value from an off line chart?

 
What part of "There is no M2 in MT4," was unclear? Your generator creates a chart period x. So read your indicator with x.
Reason: