ENUMERATIONS and DOUBLE

 

I have the double array[] where  all my settings for  the indicators are , but also I use this array for other things

is there a way to init the indicator using setings from the double array and not to have a warning . I really do not like warning messages in my code :)

int OnInit()
  {

   double array[4]={20,0,1,1};

// even this is no ok :)
//int varIndHandle1=iMA(NULL,PERIOD_CURRENT
//                      ,(int)array[0]
//                      ,(int)array[1]
//                      ,(int)array[2]
//                      ,(int)array[3]
//                      );

// but this has a warnings

   int                  varIndParam0_MAPeriod      = (int)array[0];          //
   int                  varIndParam1_Shift         = (int)array[1];          //
   ENUM_MA_METHOD       varIndParam2_Method        = (int)array[2];          //
   ENUM_APPLIED_PRICE   varIndParam3_AppliedPrice  = (int)array[3];          //

   int varIndHandle2=iMA(NULL,PERIOD_CURRENT
                         ,varIndParam0_MAPeriod
                         ,varIndParam1_Shift
                         ,varIndParam2_Method
                         ,varIndParam3_AppliedPrice);

//  how to lose warnings ???????????????  but to have DOUBLE array ?????


   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
 
Marcin Rutkowski:

I have the double array[] where  all my settings for  the indicators are , but also I use this array for other things

is there a way to init the indicator using setings from the double array and not to have a warning . I really do not like warning messages in my code :)

int OnInit()
  {

   double array[4]={20,0,1,1};

// even this is no ok :)
//int varIndHandle1=iMA(NULL,PERIOD_CURRENT
//                      ,(int)array[0]
//                      ,(int)array[1]
//                      ,(int)array[2]
//                      ,(int)array[3]
//                      );

// but this has a warnings

   int                  varIndParam0_MAPeriod      = (int)array[0];          //
   int                  varIndParam1_Shift         = (int)array[1];          //
   ENUM_MA_METHOD       varIndParam2_Method        = (ENUM_MA_METHOD)array[2];          //
   ENUM_APPLIED_PRICE   varIndParam3_AppliedPrice  = (ENUM_APPLIED_PRICE)array[3];          //

   int varIndHandle2=iMA(NULL,PERIOD_CURRENT
                         ,varIndParam0_MAPeriod
                         ,varIndParam1_Shift
                         ,varIndParam2_Method
                         ,varIndParam3_AppliedPrice);

//  how to lose warnings ???????????????  but to have DOUBLE array ?????


   return(INIT_SUCCEEDED);
  }
 
Mladen Rakic:

:) ... this was to simple :)  ...I would never think of this :)

Reason: