protected virtual DisplayTaskBag GetTaskBag(NotificationDisplayTask task)
        {
            PositionSize         positionSize         = this.GetDefaultNotificationPositionSize();
            NotificationWindowVM notificationWindowVM = this.GetNotificationWindowVM(task, positionSize);

            return(new DisplayTaskBag(task, notificationWindowVM, DateTime.UtcNow, positionSize));
        }
Beispiel #2
0
        public void AbsorbFrom(ContextScript found, bool absorbParams = false)
        {
            if (found == null)
            {
                return;
            }
            //KEEP_CLONE_UNDEFINED this.Name = found.Name;
//			this.Symbol = found.Symbol;
//			this.DataSourceName = found.DataSourceName;
//			this.ScaleInterval = found.ScaleInterval.Clone();
//			this.DataRange = found.DataRange.Clone();
//			this.ChartStreaming = found.ChartStreaming;
//			this.ShowRangeBar = found.ShowRangeBar;
            base.AbsorbFrom(found);

            this.PositionSize = found.PositionSize.Clone();
            if (absorbParams)
            {
                this.ParameterValuesById = new Dictionary <int, double>(found.ParameterValuesById);
            }
            //this.ChartBarSpacing = found.ChartBarSpacing;
            this.ChartAutoSubmitting       = found.ChartAutoSubmitting;
            this.BacktestOnRestart         = found.BacktestOnRestart;
            this.BacktestOnSelectorsChange = found.BacktestOnSelectorsChange;
            this.ReporterShortNamesUserInvokedJSONcheck = new List <string>(found.ReporterShortNamesUserInvokedJSONcheck);
        }
Beispiel #3
0
        public void Serialize(Barcode control)
        {
            position = new PositionSize(control);
            ContID   = control.Name;
            EnText   = control.GetEncodedText();
            type     = control.GetBarcodeType();

            ControlVisibility = control.Visibility;
        }
 public DisplayTaskBag(
     [NotNull] NotificationDisplayTask task,
     [NotNull] NotificationWindowVM windowVM,
     DateTime enqueueTime,
     PositionSize positionSize)
 {
     Assert.ArgumentNotNull(task, "task");
     Assert.ArgumentNotNull(windowVM, "windowVM");
     this.Task         = task;
     this.WindowVM     = windowVM;
     this.EnqueueTime  = enqueueTime;
     this.PositionSize = positionSize;
 }
Beispiel #5
0
        public NotificationWindowVM(
            [NotNull] PositionSize actualPositionAndSize,
            [NotNull] IResultProvider nestedNotificationVM,
            [NotNull] string originator)
        {
            Assert.ArgumentNotNull(actualPositionAndSize, "actualPositionAndSize");
            Assert.ArgumentNotNull(nestedNotificationVM, "nestedNotificationVM");
            Assert.ArgumentNotNullOrEmpty(originator, "originator");
            this.positionAndSize                      = actualPositionAndSize;
            this.positionAndSize.Changed             += this.PositionAndSizeOnChanged;
            this.NestedNotificationVM                 = nestedNotificationVM;
            this.NestedNotificationVM.ResultObtained += this.OnResultObtainedFromNestedNotification;
            this.isAlive = true;
            this.permanentCloseDescription = this.GetPermanentCloseDescription(originator);
            this.Result = new NotificationResult(ResultCode.Unspecified);

            this.CloseCommand          = new RelayCommand(this.OnCloseCommandExecute, true);
            this.PermanentCloseCommand = new RelayCommand(this.OnPermanentlyCloseExecute, true);
        }
Beispiel #6
0
        protected ContextScript() : base()
        {
            PositionSize              = new PositionSize(PositionSizeMode.SharesConstantEachTrade, 1);
            ParameterValuesById       = new Dictionary <int, double>();
            IsCurrent                 = false;
            ChartAutoSubmitting       = false;
            BacktestOnRestart         = true;
            BacktestOnSelectorsChange = true;
            ReporterShortNamesUserInvokedJSONcheck = new List <string>();
            ReportersSnapshots = new Dictionary <string, object>();

            ApplyCommission               = false;
            EnableSlippage                = false;
            LimitOrderSlippage            = false;
            RoundEquityLots               = false;
            RoundEquityLotsToUpperHundred = false;
            SlippageTicks = 1;
            SlippageUnits = 1.0;
        }
 protected virtual NotificationWindowVM GetNotificationWindowVM(NotificationDisplayTask task, PositionSize actualPositionAndSize)
 {
     return(new NotificationWindowVM(actualPositionAndSize, task.RelatedSpecializedNotification, task.Originator));
 }