One function contingent to another condition

 

Hi, please help.  What is the simplest and easiest way to call a function contingent to a once off trigger/ condition?  For example say that the price hits a certain target and I want to call a function based on this trigger.  What I have so far:

void Trailing(){
   //Some variables, For loop and OrderSelect ....
   if(Bid-OrderOpenPrice()>TSTPtrail){ //This condition is the trigger and might only be hit once
      Stop_LossS(); //My question is: when I call thse functions, they don't work consistently
      Trailing_StopB();
     }
    }
void Stop_Loss(){
   //Some variables, For loop and OrderSelect ....                  
   if(OrderType()==OP_SELL){
      if(Bid-OrderOpenPrice()<TSTPStop){ //These are ongoing
      //OrderModify .....
     }
    }             
   }