Passing mqlparam as optional

For some reason I can’t find a solution.
I am trying to declare an optional MqlParam parameter In a method:

void F(MqlParam &parm=NULL)    // here the = is not accepted because it's a reference parameter. I try to make the parameter optional
 {
 }

but
the compiler will not accept an assignment to a reference parameter.
Any ideas?

IndicatorCreate is an example where the 5th parameter is what I want.

I think you have to ‘split’ the parameters you want to change:

...
input int            MA_Period=13; 
int _MA_Period, 
     MA_handle;
...
void OnInit() {
...
   _MA_Period = MA_Period <= 0 ? 14 : MA_Period;
...
MA_handle=iCustom(NULL,0,"Examples\\Custom Moving Average", 
                     _MA_Period, 
                     MA_Shift, 
                     MA_Method, 
                     PRICE_CLOSE // using the close prices 
          );
}

Sorry I don’t get it.
What I want to do again. is define a function F() with optional parameter of type MqlParam:

void F(MqlParam &parm=NULL)    // here the = is not accepted because it's a reference parameter. I try to make the parameter optional
 {
 }

OnStart()
  {
    F();   // this call to F without parm is what I need
  }

A reference can not be NULL. Either make two functions or make it a pointer, and add an additional shim.

void F(MqlParam &parm){ F(GetPointer(param) ); }
void F(MqlParam *parm=NULL)
 {
 }

Thanks, but struct does not have pointer apparently.

void F(MqlParam *parm=NULL) // does not compile because MqlParam is a struct
 {
 }

I like @saar_solt first idea: *use two functions

void OnStart()
{
    // Call with no parameters
    F();

    // Call with a parameter
    MqlParam mparm = {TYPE_BOOL,1,1.0,"string"};        // Initialize
    F(mparm);
}

 
void F(MqlParam& parm)
{
    // Dummy parm passed?
    if ( parm.integer_value == 0 )
    {
        Print("NOOP");
    }
    else
    {
        Print(parm.type);
        Print(parm.integer_value);
        Print(parm.double_value);
        Print(parm.string_value);
    }
}

// No parameter version simple sends a dummy parm
void F(void)
{
    MqlParam parm = {0};
    F(parm);
}

Many thanks @saar_solt , and @kturevillep for elaborating what I missed in his answer.

Or use a class:

class CMqlParam
  {
public:
   ENUM_DATATYPE     type;
   long              integer_value;
   double            double_value;
   string            string_value;

                     CMqlParam(ENUM_DATATYPE t,long i,double d,string s) : type(t),integer_value(i),double_value(d),string_value(s) {};
                     CMqlParam(MqlParam &p) : type(p.type),integer_value(p.integer_value),double_value(p.double_value),string_value(p.string_value) {};
  };

void F(CMqlParam *parm=NULL)
  {
//--- do your stuff
   if(parm==NULL)
     {
      Print("NOOP");
     }
   else
     {
      Print(parm.type);
      Print(parm.integer_value);
      Print(parm.double_value);
      Print(parm.string_value);
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart()
  {
   MqlParam param={TYPE_DATETIME,0,100.0,""};
   CMqlParam myparam1(TYPE_BOOL,1,1.0,"string");
   CMqlParam myparam2(param);

   F(&myparam1);
   F(&myparam2);
   F();
  }