Skip to content

Commit

Permalink
Fixed an issue with the Insync Index calculation using the wrong Boll…
Browse files Browse the repository at this point in the history
…inger Bands method #43

Made some minor changes for better code readability
  • Loading branch information
ooples committed Aug 8, 2023
1 parent 6371525 commit 2602ee9
Show file tree
Hide file tree
Showing 22 changed files with 778 additions and 778 deletions.
20 changes: 10 additions & 10 deletions src/Calculations/BollingerBands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static partial class Calculations
/// </summary>
/// <param name="stockData">The stock data.</param>
/// <param name="stdDevMult">The standard dev mult.</param>
/// <param name="movingAvgType">Average type of the moving.</param>
/// <param name="maType">Average type of the moving.</param>
/// <param name="length">The length.</param>
/// <returns></returns>
public static StockData CalculateBollingerBands(this StockData stockData, MovingAvgType maType = MovingAvgType.SimpleMovingAverage,
Expand Down Expand Up @@ -50,7 +50,7 @@ public static StockData CalculateBollingerBands(this StockData stockData, Moving
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", upperBandList },
{ "MiddleBand", smaList },
Expand Down Expand Up @@ -121,7 +121,7 @@ public static StockData CalculateAdaptivePriceZoneIndicator(this StockData stock
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", outerUpBandList },
{ "MiddleBand", middleBandList },
Expand Down Expand Up @@ -201,7 +201,7 @@ public static StockData CalculateAutoDispersionBands(this StockData stockData, M
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", upperBandList },
{ "MiddleBand", middleBandList },
Expand Down Expand Up @@ -264,7 +264,7 @@ public static StockData CalculateBollingerBandsFibonacciRatios(this StockData st
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", fibTop3List },
{ "MiddleBand", smaList },
Expand Down Expand Up @@ -317,7 +317,7 @@ public static StockData CalculateBollingerBandsAvgTrueRange(this StockData stock
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "AtrDev", atrDevList }
};
Expand Down Expand Up @@ -382,7 +382,7 @@ public static StockData CalculateBollingerBandsWithAtrPct(this StockData stockDa
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", upperList },
{ "MiddleBand", smaList },
Expand Down Expand Up @@ -429,7 +429,7 @@ public static StockData CalculateBollingerBandsPercentB(this StockData stockData
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "PctB", pctBList }
};
Expand Down Expand Up @@ -477,7 +477,7 @@ public static StockData CalculateBollingerBandsWidth(this StockData stockData, d
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "BbWidth", bbWidthList }
};
Expand Down Expand Up @@ -579,7 +579,7 @@ public static StockData CalculateVervoortModifiedBollingerBandIndicator(this Sto
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "UpperBand", ubList },
{ "MiddleBand", percbList },
Expand Down
26 changes: 13 additions & 13 deletions src/Calculations/Chande.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static StockData CalculateChandeQuickStick(this StockData stockData, Movi
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cqs", smaList }
};
Expand Down Expand Up @@ -105,7 +105,7 @@ public static StockData CalculateChandeMomentumOscillatorFilter(this StockData s
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmof", cmoList },
{ "Signal", cmoSignalList }
Expand Down Expand Up @@ -151,7 +151,7 @@ public static StockData CalculateChandeMomentumOscillatorAbsolute(this StockData
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmoa", cmoAbsList }
};
Expand Down Expand Up @@ -208,7 +208,7 @@ public static StockData CalculateChandeMomentumOscillatorAverage(this StockData
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmoa", cmoAvgList }
};
Expand Down Expand Up @@ -265,7 +265,7 @@ public static StockData CalculateChandeMomentumOscillatorAbsoluteAverage(this St
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmoaa", cmoAbsAvgList }
};
Expand Down Expand Up @@ -360,7 +360,7 @@ public static StockData CalculateChandeCompositeMomentumIndex(this StockData sto
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Ccmi", eList },
{ "Signal", sList }
Expand Down Expand Up @@ -410,7 +410,7 @@ public static StockData CalculateChandeMomentumOscillatorAverageDisparityIndex(t
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmoadi", avgDisparityIndexList }
};
Expand Down Expand Up @@ -463,7 +463,7 @@ public static StockData CalculateChandeKrollRSquaredIndex(this StockData stockDa
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Ckrsi", r2SmoothedList }
};
Expand Down Expand Up @@ -515,7 +515,7 @@ public static StockData CalculateChandeVolatilityIndexDynamicAverageIndicator(th
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cvida1", vidya1List },
{ "Cvida2", vidya2List }
Expand Down Expand Up @@ -557,7 +557,7 @@ public static StockData CalculateChandeTrendScore(this StockData stockData, int
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cts", tsList }
};
Expand Down Expand Up @@ -595,7 +595,7 @@ public static StockData CalculateChandeForecastOscillator(this StockData stockDa
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cfo", pfList }
};
Expand Down Expand Up @@ -645,7 +645,7 @@ public static StockData CalculateChandeIntradayMomentumIndex(this StockData stoc
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cimi", imiUnfilteredList }
};
Expand Down Expand Up @@ -704,7 +704,7 @@ public static StockData CalculateChandeMomentumOscillator(this StockData stockDa
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Cmo", cmoList },
{ "Signal", cmoSignalList }
Expand Down
12 changes: 6 additions & 6 deletions src/Calculations/Demark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static StockData CalculateDemarkRangeExpansionIndex(this StockData stockD
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Drei", reiList }
};
Expand Down Expand Up @@ -116,7 +116,7 @@ public static StockData CalculateDemarkPressureRatioV1(this StockData stockData,
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Dpr", pressureRatioList }
};
Expand Down Expand Up @@ -171,7 +171,7 @@ public static StockData CalculateDemarkPressureRatioV2(this StockData stockData,
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Dpr", pressureRatioList }
};
Expand Down Expand Up @@ -217,7 +217,7 @@ public static StockData CalculateDemarkReversalPoints(this StockData stockData,
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Drp", drpPriceList }
};
Expand Down Expand Up @@ -262,7 +262,7 @@ public static StockData CalculateDemarkSetupIndicator(this StockData stockData,
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Dsi", drpPriceList }
};
Expand Down Expand Up @@ -318,7 +318,7 @@ public static StockData CalculateDemarker(this StockData stockData, MovingAvgTyp
signalsList.Add(signal);
}

stockData.OutputValues = new()
stockData.OutputValues = new Dictionary<string, List<double>>
{
{ "Dm", demarkerList }
};
Expand Down
Loading

0 comments on commit 2602ee9

Please sign in to comment.