Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public IList <int> Execute(IOption source)
 {
     MakeList(source.UnderlyingAsset.Bars.Count, source.GetStrikes().Count());
     return(this);
 }
Ejemplo n.º 3
0
        public IList <Double2> Execute(IOption source, IReadOnlyList <InteractiveObject> data)
        {
            var strikes = source.GetStrikes().ToArray();

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

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