Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bugs fixed
  • Loading branch information
Miroslav Popov authored and Miroslav Popov committed Dec 28, 2017
1 parent 0d06c9b commit 2d51808
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Indicators/Store/BarRange.cs
Expand Up @@ -75,20 +75,20 @@ public override void Calculate(IDataSet dataSet)
DataSet = dataSet;

// Reading the parameters
var barsCount = (int)IndParam.NumParam[0].Value;
var period = (int)IndParam.NumParam[0].Value;
double level = IndParam.NumParam[1].Value;
int previous = IndParam.CheckParam[0].Checked ? 1 : 0;

// Calculation
int firstBar = barsCount + previous + 2;
int firstBar = period + previous + 2;

var range = new double[Bars];

for (int bar = firstBar; bar < Bars; bar++)
{
double maxHigh = double.MinValue;
double minLow = double.MaxValue;
for (int i = 0; i < barsCount; i++)
for (int i = 0; i < period; i++)
{
if (High[bar - i] > maxHigh)
maxHigh = High[bar - i];
Expand Down
4 changes: 2 additions & 2 deletions Indicators/Store/CumulativeSum.cs
Expand Up @@ -25,7 +25,7 @@ public CumulativeSum()
SeparatedChart = true;

IndicatorAuthor = "Miroslav Popov";
IndicatorVersion = "2.0";
IndicatorVersion = "2.2";
IndicatorDescription = "Bundled in FSB distribution.";
}

Expand Down Expand Up @@ -96,7 +96,7 @@ public override void Calculate(IDataSet dataSet)
int previous = IndParam.CheckParam[0].Checked ? 1 : 0;

// Calculation
int firstBar = period + previous + 2;
int firstBar = period + smoothing + previous + 2;

double[] price = Price(basePrice);
var cumulativeSum = new double[Bars];
Expand Down
6 changes: 3 additions & 3 deletions Indicators/Store/IchimokuKinkoHyo.cs
Expand Up @@ -121,7 +121,7 @@ public override void Calculate(IDataSet dataSet)
double sigma = Sigma();

var tenkanSen = new double[Bars];
for (int bar = firstBar; bar < Bars; bar++)
for (int bar = tenkan - 1; bar < Bars; bar++)
{
double highestHigh = double.MinValue;
double lowestLow = double.MaxValue;
Expand All @@ -136,7 +136,7 @@ public override void Calculate(IDataSet dataSet)
}

var kijunSen = new double[Bars];
for (int bar = firstBar; bar < Bars; bar++)
for (int bar = kijun - 1; bar < Bars; bar++)
{
double highestHigh = double.MinValue;
double lowestLow = double.MaxValue;
Expand All @@ -163,7 +163,7 @@ public override void Calculate(IDataSet dataSet)
}

var senkouSpanB = new double[Bars];
for (int bar = firstBar; bar < Bars - kijun; bar++)
for (int bar = senkou - 1; bar < Bars - kijun; bar++)
{
double highestHigh = double.MinValue;
double lowestLow = double.MaxValue;
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Store/MAOscillator.cs
Expand Up @@ -110,7 +110,7 @@ public override void Calculate(IDataSet dataSet)
double[] maSlow = MovingAverage(slowPeriod, 0, maMethod, Price(basePrice));
var oscillator = new double[Bars];

for (int bar = slowPeriod; bar < Bars; bar++)
for (int bar = firstBar; bar < Bars; bar++)
{
oscillator[bar] = maFast[bar] - maSlow[bar];
}
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Store/TrailingStop.cs
Expand Up @@ -84,7 +84,7 @@ public override void Calculate(IDataSet dataSet)
CompName = "Trailing Stop for the transferred position",
DataType = IndComponentType.Other,
ShowInDynInfo = false,
FirstBar = 1,
FirstBar = 2,
Value = new double[Bars]
};
}
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Store/TrixMAOscillator.cs
Expand Up @@ -110,7 +110,7 @@ public override void Calculate(IDataSet dataSet)
int previous = IndParam.CheckParam[0].Checked ? 1 : 0;

// Calculation
int firstBar = Math.Max(period1, period2) + 2;
int firstBar = Math.Max(period1, period2) + previous + 2;
var oscillator = new double[Bars];

// ---------------------------------------------------------
Expand Down

0 comments on commit 2d51808

Please sign in to comment.