Discussion of article "The Price Histogram (Market Profile) and its implementation in MQL5" - page 2

 

2010.03.09 21:12:54 PriceHistogram (#DD,MN1) There is no accessible history PERIOD_D1

 
gen5s:

Wonderful counsellor! Was...

The problem appeared since 251 build. Now on newer builds is not reflected at all, although the log says that it is loaded.

Something may need to be changed, moved to another directory?

Thanks for your attention, I really made a mistake. Fixed. Wait for an update.

PS

There was an error in the search for max/min arrays, after fixing it, a bug appeared in the EA code

in ClassPriceHistogram.mqh lines 188,189 and 205 it is necessary to fix WHOLE_ARRAY to 0.

 
bcsunwww:

 

2010.03.09 21:12:54 PriceHistogram (#DD,MN1) There is no accessible history PERIOD_D1

Thank you for your message. Fixed, wait for updates.
 
mql5:

Thanks for pointing that out, I did make a mistake. It's fixed. Wait for the update.

PS

There was an error in the search for max/min arrays, after fixing it a bug appeared in the Expert Advisor's code.

in ClassPriceHistogram.mqh lines 188,189 and 205 it is necessary to correct WHOLE_ARRAY to 0.

Thank you for suggesting (WHOLE_ARRAY), because I was already tired of searching for the error.
 
vdv2001:
Thanks for the tip(WHOLE_ARRAY), I was already tired of looking for the error.
Unfortunately, this is not the only error in the expert's code. We will try to find and fix the source code.
 

PriceHistogram.mq5 does not work on chart. Meta editor error messages are in attached file.

Files:
 

Replaced the included file ClassPriceHistogramA.mqh:

  • reduced the number of attempts to copy price data AMOUNT_OF_ATTEMPTS=2;
  • added PrintErrorOnCopyFunction() function to output messages when an attempt to execute CopyXXX() function fails.
    //+------------------------------------------------------------------+
    //| displays a message when copying fails |
    //+------------------------------------------------------------------+
    void PrintErrorOnCopyFunction(string func_name,string symbol,ENUM_TIMEFRAMES tf,int err_code)
      {
       Print(func_name," Failed to copy price data, error",err_code);
       Print("The very first date by symbol-period "+
             symbol+" "+TimeframeToString(tf)+
             " for now = "+
             (datetime)SeriesInfoInteger(symbol,tf,SERIES_FIRSTDATE));
       Print("The very first date in history by symbol on the server =",
             (datetime)SeriesInfoInteger(symbol,tf,SERIES_SERVER_FIRSTDATE));
       Print("Symbol data synchronised =",
             (bool)SeriesInfoInteger(symbol,tf,SERIES_SYNCRONIZED));
       int bars=Bars(symbol,tf);
       int max_bars_in_chart=TerminalInfoInteger(TERMINAL_MAXBARS);
       Print("Number of bars in history by corresponding symbol period = ",bars,
             "   max_bars_in_chart =",max_bars_in_chart);
       datetime firstbar[];
       int copied=CopyTime(symbol,tf,bars-1,1,firstbar);
       if(copied<0)
         {
          Print("The first available bar has an opening time.",firstbar[0]);
          Comment("You may need to increase the value of 'Maximum number of bars on chart'");
         }
       else Print("Failed to get an opening time of the oldest available bar");
       ResetLastError();
      }
It would be more correct to check for available history before CopyXXX() operations, analyse the number of bars on the chart using the
TerminalInfoInteger(TERMINAL_MAXBARS);
and make an attempt to swap the data (if it makes sense) as in the example Organising access to data
 

Now it works perfectly. Please download the updated files.

The full documentation of source codes of the article is available now: The Price Histogram (Market Profile) and its implementation in MQL5

The documentation has been created by Doxygen.

See details in the article Auto-Generated Documentation for MQL5 Code.

The Price Histogram (Market Profile) and its implementation in MQL5
The Price Histogram (Market Profile) and its implementation in MQL5
  • 2010.01.28
  • Dmitry
  • www.mql5.com
The Market Profile was developed by trully brilliant thinker Peter Steidlmayer. He suggested to use the alternative representation of information about "horizontal" and "vertical" market movements that leads to completely different set of models. He assumed that there is an underlying pulse of the market or a fundamental pattern called the cycle of equilibrium and disequilibrium. In this article I will consider Price Histogram - a simplified model of Market Profile, and will describe its implementation in MQL5.
 

Everything works now. Please download the updated files.

Added documentation to the source codes given in the article: Market_Profile_Help.rar


The documentation was created with the help of Doxygen programme.

Details in the article Automatic creation of documentation for MQL5 programmes.

 
Automated-Trading писал(а) # :

Everything works now. Please download the updated files.

It doesn't work, can't handle the timing of the first bar and gives a warning when compiling. "implicit conversion from 'number' to 'string' ClassPriceHistogram.mqh 404 10"

build 256 I attach the log.