Displaying Dots in Histogram

 
Greetings,

I would like to inquire about displaying dots in a histogram.

When the Shape style of an indicator is set to DRAW_HISTOGRAM and the line style is set to STYLE_DOT, changing the chart scale to 4 or 5 causes the line width to become STYLE_SOLID, even when the width is set to 1.

Is there a way to implement an indicator, like "Ichimoku Kinko Hyo" in MT4, where the line style remains unchanged even when zooming in?

Thank you for your assistance.

Best regards,



#property strict
#property indicator_chart_window

#property indicator_buffers 2
input color in_color = clrWhite;             //Color
input ENUM_LINE_STYLE in_style = STYLE_DOT;  //Line Style

double buffer1[];
double buffer2[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0, DRAW_HISTOGRAM, in_style, 1, in_color);
   SetIndexBuffer(0, buffer1);
   SetIndexBuffer(1, buffer2);

   ChartSetInteger(ChartID(), CHART_SCALE,           3);
   ChartSetInteger(ChartID(), CHART_FOREGROUND,      true);
   ChartSetInteger(ChartID(), CHART_SHOW_GRID,       false);
   ChartSetInteger(ChartID(), CHART_SHOW_PERIOD_SEP, false);
   ChartSetInteger(ChartID(), CHART_MODE,            CHART_CANDLES);
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---
   ArraySetAsSeries(high,     true);
   ArraySetAsSeries(low,      true);
   ArraySetAsSeries(buffer1,  true);
   ArraySetAsSeries(buffer2,  true);

   int limit = rates_total - prev_calculated;
   
   if (prev_calculated == 0) {
      limit = rates_total - 1;
   }
   for (int i = limit; i >= 0; i--) {
      buffer1[i] = high[i] * 1.002;
      buffer2[i] = low[i]  * 0.998;
   }

   if (prev_calculated == 0) {
      EventSetTimer(2); //2 seconds
   }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
  
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   EventKillTimer();
   
   ChartSetInteger(ChartID(), CHART_SCALE, 4);
   ChartSetInteger(ChartID(), CHART_SHIFT, true);   
  }
//+------------------------------------------------------------------+

Scale = 3 Scale = 4

 
Yutaka Okamoto:
Greetings,

I would like to inquire about displaying dots in a histogram.

When the Shape style of an indicator is set to DRAW_HISTOGRAM and the line style is set to STYLE_DOT, changing the chart scale to 4 or 5 causes the line width to become STYLE_SOLID, even when the width is set to 1.

Is there a way to implement an indicator, like "Ichimoku Kinko Hyo" in MT4, where the line style remains unchanged even when zooming in?

Thank you for your assistance.

Best regards,



I have received a response from the support team regarding this issue.

Support Team 2024.04.24 19:54

Dear user,


No changes in MetaTrader 4 are planned. Maybe someday it will be fixed, but we don't have any ETA.

We suggest switching to MetaTrader 5.


Best regards,

MQL5.com Support Team