CRB chart source code / pseudocode

 

Hi, can anyone share with me a working source code to build CONSTANT RANGE BAR charts ? Pseudocode is also accepted, i have no clue how to do it, and I cant find any tutorial on the internet which would explain how CRB charts are constructed.

I dont want RENKO CHART, there is a difference, I want CRB chart. So can anyone help me please?

 
well - google and you'll find a lot!!
 
gooly:
well - google and you'll find a lot!!
Please give me link, i could not find any that is useful. Most of it crashed after i opened in MT4.
 

This moght depend on the new version - open them in the mt4 editor and try to compile them and eliminate the problems.

Or google more.

 
Proximus:

Hi, can anyone share with me a working source code to build CONSTANT RANGE BAR charts ? Pseudocode is also accepted, i have no clue how to do it, and I cant find any tutorial on the internet which would explain how CRB charts are constructed.

I dont want RENKO CHART, there is a difference, I want CRB chart. So can anyone help me please?

  1. My classes attached
    #include "crb.mqh"
    cCRB  gCRB;
    void  ChartUpdated(const cChart& aCrt, bool isFinal=false){
       :  // Update other things depending on CRB
    }
    int OnCalculate (...){
       int    counted_bars  = IndicatorCounted();
       if(counted_bars < 0) return (-1);
       if(counted_bars == 0){  gCRB.Initialize(CRB_Pips); // History refresh
                                                          // or parameter change.
                               counted_bars = 1; }  // Color Lookback
    
       for(int  iBeg = Bars - 1 - counted_bars; iBeg >= 0; --iBeg){
          gCRB.Update(iBeg);
          ChartUpdated(gCRB);  // Update SMI with CRB's current close.
          :
  2. Renko, Point and Figure, Constant Range Bars are all the same, price based chart. They vary by how they start a new bar.
    • Renko: New open in the current direction is one block from the current open. In the opposite direction, two blocks.
    • Point and Figure: No new in the current direction. In the opposite direction, three blocks back from the highest completed block.
    • Constant range bars: New when price exceeds current low plus block size or current high minus block size.
Files:
crb.mqh  5 kb
chart.mqh  5 kb
 
WHRoeder:
  1. My classes attached
  2. Renko, Point and Figure, Constant Range Bars are all the same, price based chart. They vary by how they start a new bar.
    • Renko: New open in the current direction is one block from the current open. In the opposite direction, two blocks.
    • Point and Figure: No new in the current direction. In the opposite direction, three blocks back from the highest completed block.
    • Constant range bars: New when price exceeds current low plus block size or current high minus block size.

Ok that is a good explanation thanks, so 1 more question.

In the CRB chart, what values do the OPEN,HIGH,LOW,CLOSE get, and how are they calculated. I see that the HIGH-LOW is always the size of the range, but the close may vary so please explain.

 
Proximus: In the CRB chart, what values do the OPEN,HIGH,LOW,CLOSE get, and how are they calculated. I see that the HIGH-LOW is always the size of the range, but the close may vary so please explain.
Open is equal to the previous bars close (+1 point in my code.)
H/L/C change as price moves up or down just like time based chart.
When C tries to exceed the range, a new bar starts and previous bar's C equals H or L.
 
WHRoeder:
Open is equal to the previous bars close (+1 point in my code.)
H/L/C change as price moves up or down just like time based chart.
When C tries to exceed the range, a new bar starts and previous bar's C equals H or L.
Thanks, i shall try and build a CRB script from these informations. I don't like translating other people's code I like to build it myself from scratch.
Reason: