Skip to content

CalculateInsyncIndex throws the following exception #43

@HamzaAhmedZia7

Description

@HamzaAhmedZia7

Greetings Franklin,

This code

var bars = stockHistoryDaily[@"RELIANCE"];
var stockData = new StockData(bars.Select(x => x.Open), bars.Select(x => x.High), bars.Select(x => x.Low), bars.Select(x => x.Close), bars.Select(x => x.Volume), bars.Select(x => x.DateTime));
var insyncResults = stockData.CalculateInsyncIndex();
var insyncIndex = insyncResults.OutputValues["Iidx"];

produces this exception

OoplesFinance.StockIndicators.Exceptions.CalculationException: Calculations based off of BollingerBands can't be completed because this indicator doesn't have a single output.
   at OoplesFinance.StockIndicators.Helpers.CalculationsHelper.GetInputValuesList(StockData stockData)
   at OoplesFinance.StockIndicators.Calculations.CalculateDetrendedPriceOscillator(StockData stockData, MovingAvgType maType, Int32 length)
   at OoplesFinance.StockIndicators.Calculations.CalculateInsyncIndex(StockData stockData, MovingAvgType maType, Int32 fastLength, Int32 slowLength, Int32 signalLength, Int32 emoLength, Int32 mfiLength, Int32 bbLength, Int32 cciLength, Int32 dpoLength, Int32 rocLength, Int32 rsiLength, Int32 stochLength, Int32 stochKLength, Int32 stochDLength, Int32 smaLength, Double stdDevMult, Double divisor)
   at Program.<Main>$(String[] args) in 

in method CalculateDetrendedPriceOscillator at line CalculationsHelper.GetInputValuesList(stockData).inputList;

      this StockData stockData,
      MovingAvgType maType = MovingAvgType.SimpleMovingAverage,
      int length = 20)
    {
      List<double> doubleList = new List<double>();
      List<Signal> signalList = new List<Signal>();
      List<double> inputList = CalculationsHelper.GetInputValuesList(stockData).inputList;
      int num1 = MathHelper.MinOrMax(checked ((int) Math.Ceiling(unchecked ((double) length / 2.0 + 1.0))));
      List<double> movingAverageList = CalculationsHelper.GetMovingAverageList(stockData, maType, length, inputList);
      int index = 0;

It is called by this code

      List<double> customValuesList5 = stockData1.CalculateBollingerBands(length: length, stdDevMult: stdDevMult1).CustomValuesList;
      List<double> customValuesList6 = stockData.CalculateDetrendedPriceOscillator(length: dpoLength).CustomValuesList;
      List<double> customValuesList7 = stockData.CalculateRateOfChange(rocLength).CustomValuesList;

I am trying out your excellent humongous library. :-)

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions