что я делаю не так?

 

День добрый!

//+------------------------------------------------------------------+
//|                                                  Thermometer.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_separate_window
#property indicator_minimum 0
#property indicator_maximum 120
#property indicator_buffers 1
#property indicator_plots   1
//--- plot Label1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrWhite
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1


#include <ST_ServicesAndAbstracts.mqh>


//--- indicator buffers
double         gThermBuffer[];
CRangeManager *lRM;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,gThermBuffer,INDICATOR_DATA);
    lRM=new CRangeManager(1,0.2,20,Symbol());
//---
   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[])
  {
//---
   //--- variables of indicator
   int               pos;
//--- set draw begin
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,10);
   pos=prev_calculated;
   sThermometer lTherm =lRM.getCurrentState();
  // Label1Buffer[pos]=lTherm.currentT;
    for(int i = 0;i<rates_total;i++)
      {
      gThermBuffer[i]=100.0;      
      }
   
   
   
//--- return value of prev_calculated for next call
   return(pos);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   
  }
//+------------------------------------------------------------------+

 предполагаю, что в окне индикатора должна быть прямая линия по уровню 100. Ее нет. В чем туплю?

Спасибо! 

 
ns_k:

День добрый!

 предполагаю, что в окне индикатора должна быть прямая линия по уровню 100. Ее нет. В чем туплю?

Спасибо! 

Change 

   return(pos);

to

   return(rates_total);
 
angevoyageur:

Change 

to

Thanks! You are helpful as always :)
Причина обращения: