Forex_Strategy_Builder.Instrument_Editor.ValidateSymbol C# (CSharp) Method

ValidateSymbol() private method

Validates the instrument properties
private ValidateSymbol ( string symbol, Instrumet_Type instrType ) : bool
symbol string
instrType Instrumet_Type
return bool
        bool ValidateSymbol(string symbol, Instrumet_Type instrType)
        {
            bool isResult = false;

            if (instrType == Instrumet_Type.Forex)
            {
                Regex regex = new Regex(@"^[A-Z]{6}$");
                isResult = (regex.IsMatch(symbol) && symbol.Substring(0,3) != symbol.Substring(3,3));
            }
            else
            {
                Regex regex = new Regex(@"^[a-zA-Z\$\#]");
                isResult = regex.IsMatch(symbol);
            }

            return isResult;
        }