How do I call value from a function

 

void tick{

//How would I get WantedValue to test against

if(CurrentAsk < PreviousAsk+WantedValue){

OrderSend(XXXXXX);

}

}

//////////////My Functions

double My_Function(double WantedValue){

      WantedValue = 0.051;

      return (WantedValue);

}

 
Tony Chavez:

void tick{

//How would I get WantedValue to test against

if(CurrentAsk < PreviousAsk+0.051){

OrderSend(XXXXXX);

}

}

//////////////My Functions

double My_Function(double WantedValue){

      WantedValue = 0.051;

      return (WantedValue);

}

Put tge function name with its parameters in the OnTick()
That's all
In your case you can even call it by a condition:
if(My_Function(Close[0])>0.1) return;
Reason: