//+------------------------------------------------------------------+
//|                                                    TypeSlots.mq5 |
//|                                                       Ali Rajput |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Ali Rajput"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property description "One input of each common type after one group, then 4 narrower types for the edge tests"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots   2
#property indicator_type1   DRAW_LINE
#property indicator_type2   DRAW_LINE
//+------------------------------------------------------------------+
//| Inputs: a group, one input per common type, 4 narrower types     |
//+------------------------------------------------------------------+
input group          "Slots"
input int            InpInt    =1;                    // int
input double         InpDouble =1.0;                  // double
input bool           InpBool   =false;                // bool
input string         InpString ="s";                  // string
input ENUM_MA_METHOD InpEnum   =MODE_SMA;             // enum
input datetime       InpTime   =D'2020.01.01';        // datetime
input color          InpColor  =clrBlack;             // color
input uchar          InpUchar  =1;                    // uchar
input short          InpShort  =1;                    // short
input uint           InpUint   =1;                    // uint
input float          InpFloat  =1.0f;                 // float
//+------------------------------------------------------------------+
//| Indicator buffers                                                |
//+------------------------------------------------------------------+
double Buf[];                                         // InpInt on every bar
double BufLen[];                                      // length of InpString as received
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexBuffer(0,Buf,INDICATOR_DATA);
   SetIndexBuffer(1,BufLen,INDICATOR_DATA);
   PrintFormat("TypeSlots received: int=%d double=%g bool=%s string of %d chars enum=%d time=%s color=%d"
               " uchar=%u short=%d uint=%u float=%g",
               InpInt,InpDouble,(InpBool ? "true" : "false"),StringLen(InpString),(int)InpEnum,
               TimeToString(InpTime),(int)InpColor,InpUchar,InpShort,InpUint,InpFloat);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
   for(int i=(prev_calculated>0 ? prev_calculated-1 : 0); i<rates_total; i++)
     {
      Buf[i]   =InpInt;
      BufLen[i]=StringLen(InpString);
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
