function declarations are allowed on global, namespace or class scope only

 
  bool GetSymbolInfoDouble(const string symbol, ENUM_SYMBOL_INFO_DOUBLE property, double &result){
  
      if(SymbolInfoDouble(symbol, property, result))
      {
         return true;  
      }
      else
      {
         Print("Failed to retrieve symbol information for: ", EnumToString(property));  
         return false; 
      }
   }

function declarations are allowed on global, namespace or class scope only

What does this error mean and how can i fix this code?

 
manosgk: What does this error mean and how can i fix this code?
  1. You are missing a closing bracket in the previous function.
  2. Also drop the unnecessary else{}.
 
William Roeder #:
  1. You are missing a closing bracket in the previous function.
  2. Also drop the unnecessary else{}.

Thanks!