Esempio n. 1
0
        public void DestroySession(AnalyzerSession session)
        {
            lock (this)
            {
                ((DataProvider)session.DataProvider).UnInitialize();
                session.UnInitialize();
                _existingSessions.Remove(session);
            }

            GeneralHelper.SafeEventRaise(SessionsUpdateEvent, this);
        }
Esempio n. 2
0
        public bool DecreaseOrderVolume(Order order, double volumeDecreasal, double allowedSlippage, double desiredPrice,
                                        out double decreasalPrice, out string operationResultMessage)
        {
            if (volumeDecreasal == order.CurrentVolume)
            {// Closing order.
                DateTime closingDateTime;
                CloseOrder(order, allowedSlippage, desiredPrice, out decreasalPrice, out closingDateTime, out operationResultMessage);
                return(true);
            }

            operationResultMessage = string.Empty;
            decreasalPrice         = desiredPrice;
            GeneralHelper.SafeEventRaise(OrderUpdatedEvent, order);
            return(true);
        }
        /// <summary>
        /// Add the object to the list of active objects and call event to notify all listeners, a new object has been added.
        /// </summary>
        /// <param name="component"></param>
        /// <returns></returns>
        public bool RegisterComponent(IFxpaBaseCompoent component)
        {
            // TracerHelper.Trace(component.Name);

            if (InitializeComponent(component) == false)
            {
                return(false);
            }

            lock (this)
            {
                if (_components.Contains(component))
                {
                    return(true);
                }
                _components.Add(component);
            }

            GeneralHelper.SafeEventRaise(new GeneralHelper.GenericDelegate <IFxpaBaseCompoent, bool>(
                                             ActiveComponentUpdateEvent), component, true);

            return(true);
        }
        /// <summary>
        /// Calculation helper function.
        /// </summary>
        public void Calculate()
        {
            Results.Clear();

            if (this.Initialized == false || this.Enabled == false)
            {
                return;
            }

            if (_dataProvider.DataUnitCount == 0)
            {
                return;
            }

            // Calculate the indicator level lines.
            OnCalculate(0, _dataProvider.DataUnitCount);

            // Start the mostly child performed signal analisys.
            Results.PerformCrossingResultAnalysis(ProvideSignalAnalysisLines());

            Results.PerformExtremumResultAnalysis();

            GeneralHelper.SafeEventRaise(IndicatorCalculatedEvent, this);
        }