public static bool ChangeIndicatorScopeIsValid(this PerformanceIndicator performanceIndicator, string indicator)
 {
     return(AssertionConcern.IsSatisfiedBy(
                AssertionConcern.AssertArgumentNotNull(indicator, Errors.IndicatorIsRequired),
                AssertionConcern.AssertArgumentLength(indicator, 2, 50, Errors.InvalidIndicator)
                ));
 }
Example #2
0
        public override Task OnLoad()
        {
            _instrument = new InstrumentModel
            {
                Name      = _asset,
                TimeFrame = _span
            };

            var account = new AccountModel
            {
                Name           = _account,
                Balance        = 50000,
                InitialBalance = 50000,
                Instruments    = new NameCollection <string, IInstrumentModel> {
                    [_asset] = _instrument
                }
            };

            var gateway = new GatewayClient
            {
                Speed    = 100,
                Name     = _account,
                Account  = account,
                Evaluate = Parse,
                Source   = ConfigurationManager.AppSettings["DataLocation"].ToString()
            };

            _rsiIndicator = new RelativeStrengthIndicator {
                Interval = 10, Name = "RSI Indicator : " + _asset
            };
            _atrIndicator = new AverageTrueRangeIndicator {
                Interval = 10, Name = "ATR Indicator : " + _asset
            };
            _bidIndicator = new MovingAverageIndicator {
                Interval = 0, Mode = MovingAverageEnum.Bid, Name = "BID Indicator : " + _asset
            };
            _askIndicator = new MovingAverageIndicator {
                Interval = 0, Mode = MovingAverageEnum.Ask, Name = "ASK Indicator : " + _asset
            };
            _performanceIndicator = new PerformanceIndicator {
                Name = "Balance"
            };

            _disposables.Add(gateway
                             .Account
                             .Instruments
                             .Values
                             .Select(o => o.PointGroups.ItemStream)
                             .Merge()
                             .Subscribe(OnData));

            CreateCharts();
            CreateGateways(gateway);

            return(Task.FromResult(0));
        }
Example #3
0
        public override Task OnLoad()
        {
            _span = TimeSpan.FromMinutes(1);

            _instrument = new InstrumentModel
            {
                Name      = _asset,
                TimeFrame = _span
            };

            var account = new AccountModel
            {
                Id             = ConfigurationManager.AppSettings["Account"],
                Name           = _account,
                Balance        = 50000,
                InitialBalance = 50000,
                Instruments    = new NameCollection <string, IInstrumentModel> {
                    [_asset] = _instrument
                }
            };

            var gateway = new GroupGatewayClient(_instrument)
            {
                Name    = _account,
                Account = account,
                //Evaluate = Parse,
                //Source = ConfigurationManager.AppSettings["Source"].ToString(),
                //Token = ConfigurationManager.AppSettings["AlpacaToken"].ToString(),
                //Secret = ConfigurationManager.AppSettings["AlpacaSecret"].ToString(),
                LiveToken    = ConfigurationManager.AppSettings["TradierLiveToken"].ToString(),
                SandboxToken = ConfigurationManager.AppSettings["TradierSandboxToken"].ToString(),
                //SnadboxToken = ConfigurationManager.AppSettings["SandboxToken"].ToString(),
                //Secret = ConfigurationManager.AppSettings["Secret"].ToString()
            };

            _imbalanceIndicator = new ImbalanceIndicator {
                Name = "Imbalance"
            };
            _performanceIndicator = new PerformanceIndicator {
                Name = "Balance"
            };

            _disposables.Add(gateway
                             .Account
                             .Instruments
                             .Values
                             .Select(o => o.PointGroups.ItemStream)
                             .Merge()
                             .Subscribe(OnData));

            CreateCharts();
            CreateGateways(gateway);

            return(Task.FromResult(0));
        }
        public PerformanceIndicator Create(CreatePerformanceIndicatorCommand command)
        {
            var performanceIndicator = new PerformanceIndicator(command.Indicator);
            performanceIndicator.Validate();
            _repository.Create(performanceIndicator);

            if (Commit())
                return performanceIndicator;

            return null;
        }
Example #5
0
        public override Task OnLoad()
        {
            var span        = TimeSpan.FromMinutes(1);
            var instrumentX = new InstrumentModel {
                Name = _assetX, TimeFrame = span
            };
            var instrumentY = new InstrumentModel {
                Name = _assetY, TimeFrame = span
            };

            var account = new AccountModel
            {
                Balance     = 50000,
                Name        = _account,
                Instruments = new NameCollection <string, IInstrumentModel>
                {
                    [_assetX] = instrumentX,
                    [_assetY] = instrumentY
                }
            };

            var gateway = new GatewayClient
            {
                Name     = _account,
                Account  = account,
                Evaluate = Parse,
                Source   = ConfigurationManager.AppSettings["DataLocation"].ToString()
            };

            _performanceIndicator = new PerformanceIndicator {
                Name = "Balance"
            };
            _scaleIndicatorX = new ScaleIndicator {
                Max = 1, Min = -1, Interval = 1, Name = "Indicators : " + _assetX
            };
            _scaleIndicatorY = new ScaleIndicator {
                Max = 1, Min = -1, Interval = 1, Name = "Indicators : " + _assetY
            };

            _disposables.Add(gateway
                             .Account
                             .Instruments
                             .Values
                             .Select(o => o.PointGroups.ItemStream)
                             .Merge()
                             .Subscribe(OnData));

            CreateCharts(instrumentX, instrumentY);
            CreateGateways(gateway);

            return(Task.FromResult(0));
        }
 public DepartmentIndicators(IndicatorsParameters parameters)
 {
     _parameters = parameters;
     Performance = new PerformanceIndicator(parameters.performanceName, 50, parameters.performanceRate);
     Relevance   = new RelevanceIndicator(parameters.relevanceName, 50, parameters.relevanceRate);
     Rationality = new RationalityIndicator(parameters.rationalityName, 50, parameters.rationalityRate);
     Comfort     = new ComfortIndicator(parameters.comfortName, 50, parameters.budgetExcessRate,
                                        parameters.consumablesLackRate, parameters.leavingRates);
     _indicators = new List <IIndicator>()
     {
         Performance, Relevance, Rationality, Comfort
     };
 }
Example #7
0
        public PerformanceIndicator Create(CreatePerformanceIndicatorCommand command)
        {
            var performanceIndicator = new PerformanceIndicator(command.Indicator);

            performanceIndicator.Validate();
            _repository.Create(performanceIndicator);

            if (Commit())
            {
                return(performanceIndicator);
            }

            return(null);
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="resource">resource</param>
        /// <returns>ApiResultPerformanceIndicator</returns>
        public ApiResultPerformanceIndicator UpdatePerformanceIndicator(long?id, PerformanceIndicator resource)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ApiException(400, "Missing required parameter 'id' when calling UpdatePerformanceIndicator");
            }

            // verify the required parameter 'resource' is set
            if (resource == null)
            {
                throw new ApiException(400, "Missing required parameter 'resource' when calling UpdatePerformanceIndicator");
            }


            var path = "/performanceIndicators/{id}";

            path = path.Replace("{format}", "json");
            path = path.Replace("{" + "id" + "}", ApiClient.ParameterToString(id));

            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            String postBody     = null;

            postBody = ApiClient.Serialize(resource);                                     // http body (model) parameter

            // authentication setting, if any
            String[] authSettings = new String[] { "FortifyToken" };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if (((int)response.StatusCode) >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling UpdatePerformanceIndicator: " + response.Content, response.Content);
            }
            else if (((int)response.StatusCode) == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling UpdatePerformanceIndicator: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((ApiResultPerformanceIndicator)ApiClient.Deserialize(response.Content, typeof(ApiResultPerformanceIndicator), response.Headers));
        }
Example #9
0
        public void Given_UK_Equity_Tracker_closely_resembles_the_UK_Corporate_Benchmark_When_there_is_a_stock_symbol_within_just_the_benchmark_Then_return_the_stock_symbol_with_both_the_position_weighting_with_0_percentage_and_the_benchmark_weighting_percentage()
        {
            // Criteria 2C
            //* Given the UK Equity Tracker closely resembles the UK Corporate Benchmark
            //* When there is a stock symbol within just the benchmark
            //* Then return the stock symbol with both the position weighting with 0% and the benchmark weighting (as %)

            var fundOnlyStock = new Stock()
            {
                Symbol = "ZIZA"
            };
            //Act
            var actual   = fm.CalculateFundPerformanceByStock(fundOnlyStock);
            var expected = new PerformanceIndicator()
            {
                FundWeightage  = 0.00M,
                IndexWeightage = 5,
                Stock          = fundOnlyStock
            };

            // Assert
            Assert.AreEqual(expected, actual);
        }
Example #10
0
        public void Given_UK_Equity_Tracker_closely_resembles_the_UK_Corporate_Benchmark_When_there_is_a_stock_symbol_within_both_the_fund_and_the_benchmark_Then_return_the_stock_symbol_with_both_the_position_weighting_and_the_benchmark_weighting()
        {
            //Criteria 2A
            //* Given the UK Equity Tracker closely resembles the UK Corporate Benchmark
            //* When there is a stock symbol within both the fund and the benchmark
            //* Then return the stock symbol with both the position weighting (as %) and the benchmark weighting (as %)
            //Arrange
            var robo = new Stock()
            {
                Symbol = "ROBO"
            };
            //Act
            var actual   = fm.CalculateFundPerformanceByStock(robo);
            var expected = new PerformanceIndicator()
            {
                FundWeightage  = 18.38M,
                IndexWeightage = 25.00M,
                Stock          = robo
            };

            // Assert
            Assert.AreEqual(expected, actual);
        }
Example #11
0
    public float CurrentTimeRateNorm;                                         ///

    void Awake()
    {
        consumablesNeed = depData.baseConsumablesNeed;           ///
        UpdateLabel();                                           ///

        resourcesChanged.AddListener(window.OnResourcesChanged); ///
        foreach (SelectionEvent se in selectionEvents)
        {
            selectionGroup?.RoomSelectionEvent.AddListener((RoomSelectionData sData) => { if (sData.type == se.type && sData.selected)
                                                                                          {
                                                                                              se.selectEvent.Invoke(sData);
                                                                                          }
                                                           });
            selectionGroup?.RoomSelectionEvent.AddListener((RoomSelectionData sData) => { if (sData.type == se.type && !sData.selected)
                                                                                          {
                                                                                              se.deselectEvent.Invoke(sData);
                                                                                          }
                                                           });
        }
        InitEvent.Invoke();                               ///
        foreach (WorkerController humanoid in _humanoids) ///
        {
            humanoid.gameObject.SetActive(false);
            humanoid.StartTransform = _resetPosition;
            humanoid.ForceTransform(_resetPosition);
        }


        pi  = new PerformanceIndicator(iParams.performanceName, 50, iParams.performanceRate); ///
        ri  = new RelevanceIndicator(iParams.relevanceName, 50, iParams.relevanceRate);
        rai = new RationalityIndicator(iParams.rationalityName, 50, iParams.rationalityRate);
        ci  = new ComfortIndicator(iParams.comfortName, 50, iParams.budgetExcessRate,
                                   iParams.consumablesLackRate, iParams.leavingRates);

        UpdateWindow(); ///
    }
 public void Update(PerformanceIndicator PerformanceIndicator)
 {
     _context.Entry<PerformanceIndicator>(PerformanceIndicator).State = System.Data.Entity.EntityState.Modified;
 }
 public void Delete(PerformanceIndicator PerformanceIndicator)
 {
     _context.PerformanceIndicator.Remove(PerformanceIndicator);
 }
 public void Update(PerformanceIndicator PerformanceIndicator)
 {
     _context.Entry <PerformanceIndicator>(PerformanceIndicator).State = System.Data.Entity.EntityState.Modified;
 }
 public void Create(PerformanceIndicator PerformanceIndicator)
 {
     _context.PerformanceIndicator.Add(PerformanceIndicator);
 }
 public void Delete(PerformanceIndicator PerformanceIndicator)
 {
     _context.PerformanceIndicator.Remove(PerformanceIndicator);
 }
 public void Create(PerformanceIndicator PerformanceIndicator)
 {
     _context.PerformanceIndicator.Add(PerformanceIndicator);
 }