Histogram line style not displaying properly on Strategy Tester

To add comments, please log in or register
Pasi Hakamaki
10784
Pasi Hakamaki  

Dear,

//+------------------------------------------------------------------+
//|                                                    Hist_test.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
#property indicator_type1 DRAW_COLOR_HISTOGRAM
#property indicator_plots 1
#property indicator_buffers 2
#property indicator_style1 STYLE_DASH
#property indicator_color1 clrRed
#property indicator_width1 0
double buff_hist[];
double buff_clr[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,buff_hist,INDICATOR_DATA);
   SetIndexBuffer(1,buff_clr,INDICATOR_COLOR_INDEX);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
   int limit;
   if(prev_calculated==0)
     {
      limit=0;
     }
   else
     {
      limit=prev_calculated-1;
     }
   for(int i=0;i<rates_total;i++)
     {
      buff_hist[i]=price[i];
      buff_clr[i]=0;
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

The above code works fine when attached to the chart. Lines are dash as should be, but when testing historical data with Strategy Tester lines are always solid. Please, can you test this and confirm that this is a bug.

Br,

Candles

Alain Verleyen
36048
Alain Verleyen  
Yes, I confirm.
Pasi Hakamaki
10784
Pasi Hakamaki  
angevoyageur:
Yes, I confirm.
Ok. Thank you, I report Service Desk.
Hao Li
562
Hao Li  
Candles:

Dear,

The above code works fine when attached to the chart. Lines are dash as should be, but when testing historical data with Strategy Tester lines are always solid. Please, can you test this and confirm that this is a bug.

Br,

Candles

thank you
Pasi Hakamaki
10784
Pasi Hakamaki  
ysu1987:
thank you
Most welcome.
Alain Verleyen
36048
Alain Verleyen  
Candles:
Most welcome.

See here

Pasi Hakamaki
10784
Pasi Hakamaki  
Ah, I see :)
To add comments, please log in or register