private ApiResponse <object> RunCalculation()
        {
            var oneOfQuantUniverse   = new OneOfQuantUniverse(new QuantScreeningExpressionUniverse("ISON_DOW", QuantScreeningExpressionUniverse.UniverseTypeEnum.Equity, "TICKER", QuantScreeningExpressionUniverse.SourceEnum.ScreeningExpressionUniverse));
            var oneOfQuantDates      = new OneOfQuantDates(new QuantFdsDate("0", "-5D", QuantFdsDate.SourceEnum.FdsDate, "D", "FIVEDAY"));
            var oneOfQuantFormulases = new List <OneOfQuantFormulas>()
            {
                new OneOfQuantFormulas(new QuantScreeningExpression("P_PRICE", "Price (SCR)", QuantScreeningExpression.SourceEnum.ScreeningExpression)),
                new OneOfQuantFormulas(new QuantFqlExpression("P_PRICE", "Price (SCR)", QuantFqlExpression.SourceEnum.FqlExpression))
            };

            var quantCalculation = new QuantCalculationParameters(universe: oneOfQuantUniverse, dates: oneOfQuantDates, formulas: oneOfQuantFormulases);

            var quantCalculationsMeta = new QuantCalculationMeta(format: QuantCalculationMeta.FormatEnum.Feather);

            var calculationParameters = new QuantCalculationParametersRoot
            {
                Data = new Dictionary <string, QuantCalculationParameters> {
                    { "1", quantCalculation }
                },
                Meta = quantCalculationsMeta
            };

            var response = calculationsApi.PostAndCalculateWithHttpInfo("max-stale=0", calculationParameters);

            return(response);
        }
Beispiel #2
0
        private static QuantCalculationParametersRoot GetQuantCalculationParameters()
        {
            var universe = new OneOfQuantUniverse(new QuantScreeningExpressionUniverse(universeExpr: "ISON_DOW", universeType: QuantScreeningExpressionUniverse.UniverseTypeEnum.Equity, securityExpr: "TICKER", source: QuantScreeningExpressionUniverse.SourceEnum.ScreeningExpressionUniverse));
            var dates    = new OneOfQuantDates(new QuantFdsDate(startDate: "0", endDate: "-5D", source: QuantFdsDate.SourceEnum.FdsDate, frequency: "D", calendar: "FIVEDAY"));
            var formulas = new List <OneOfQuantFormulas>()
            {
                new OneOfQuantFormulas(new QuantScreeningExpression(expr: "P_PRICE", name: "Price (SCR)", source: QuantScreeningExpression.SourceEnum.ScreeningExpression)),
                new OneOfQuantFormulas(new QuantFqlExpression(expr: "P_PRICE", name: "Price (SCR)", source: QuantFqlExpression.SourceEnum.FqlExpression))
            };

            var quantCalculation = new QuantCalculationParameters(universe: universe, dates: dates, formulas: formulas);

            var quantCalculationsMeta = new QuantCalculationMeta(format: QuantCalculationMeta.FormatEnum.Feather);

            var calculationParameters = new QuantCalculationParametersRoot
            {
                Data = new Dictionary <string, QuantCalculationParameters> {
                    { "1", quantCalculation }
                },
                Meta = quantCalculationsMeta
            };

            return(calculationParameters);
        }