예제 #1
0
        public static FutureOptionMessage CreateFutureOptionMessage(string futureOptionSymbol)
        {
            var m           = Regex.Match(futureOptionSymbol, FutureOptionSymbolPattern);
            var future      = FutureMessage.CreateFutureMessage(m.Groups[FutureSymbolComponent].Value);
            var optionSide  = m.Groups[FutureOptionSideComponent].Value == "C" ? OptionSide.Call : OptionSide.Put;
            var strikePrice = float.Parse(m.Groups[FutureOptionStrikePriceComponent].Value) / 100f;

            return(new FutureOptionMessage(futureOptionSymbol, future, optionSide, strikePrice));
        }
예제 #2
0
        public static FutureSpreadMessage CreateFutureSpreadMessage(string futureSpreadSymbol)
        {
            var m             = Regex.Match(futureSpreadSymbol, FutureSpreadSymbolPattern);
            var futureSymbol1 = m.Groups[FutureSymbol1Component].Value;
            var futureSymbol2 = m.Groups[FutureSymbol2Component].Value;

            return(new FutureSpreadMessage(
                       futureSpreadSymbol,
                       FutureMessage.CreateFutureMessage(futureSymbol1),
                       FutureMessage.CreateFutureMessage(futureSymbol2)
                       ));
        }