示例#1
0
        /// <summary>
        /// Обработчик под тип данных IOption
        /// </summary>
        public void Execute(IOption source)
        {
            source.UnderlyingAsset.Commission = CalculateCommission;

            bool showError = true;

            foreach (var strike in source.GetStrikes())
            {
                try
                {
                    strike.Commission = CalculateCommission;
                }
                catch (NullReferenceException nre)
                {
                    if (showError)
                    {
                        showError = false;

                        string msg = String.Format("[DEBUG:{0}] {1}. Property 'Security' is empty for strike {2}. FullName:{3}. (The message is displayed only once.)",
                                                   GetType().Name, nre.GetType().FullName, strike.Strike, strike.FinInfo.Security.FullName);
                        Context.Log(msg, MessageType.Error, true);
                    }
                }
            }
        }
示例#2
0
 public IList <int> Execute(IOption source)
 {
     MakeList(source.UnderlyingAsset.Bars.Count, source.GetStrikes().Count());
     return(this);
 }
示例#3
0
        public IList <Double2> Execute(IOption source, IReadOnlyList <InteractiveObject> data)
        {
            var strikes = source.GetStrikes().ToArray();

            return(Calculate(strikes, data));
        }
示例#4
0
        public IList <Double2> Execute(IOption source, InteractiveSeries data)
        {
            var strikes = source.GetStrikes().ToArray();

            return(Calculate(strikes, data.ControlPoints));
        }