need some help for custom functions

 

i want to do something like this but dont know is it possible, i came up this idea cause it can save me alot time and lines for codiing

int line()
{
int shift = 0;
int shift2 = 0;
int movement = 0;
double redline(shift) = iCustom(Symbol(),0,"500",0,shift);

double tealline(shift2) = iCustom(Symbol(),0,"450",1,shift2);
double sar = iSAR(Symbol(),0,0.02,0.2,0);
if (redline(0) > tealline(0))
{
   if (redline (1) < tealline(1))
      {
      movement = 1;
      }
}
// i try to set the day shift to both line above so i dont have to write so many lines just to define 1 simple line
if (redline(0) > tealline(0)) // both day get current position
{
   if (redline(1) > tealline(1)) // both day shift 1
       {
movement = 2;
}
}

return(movement);
}
Reason: