Skip to content

Commit

Permalink
increasing (#32)
Browse files Browse the repository at this point in the history
- bug fix: IsIncreasing result value was true when there was no change, see AB#567
  • Loading branch information
DaveSkender authored Jun 6, 2020
1 parent 2131990 commit 132b385
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Indicators/Rsi/Rsi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static IEnumerable<RsiResult> GetRsi(IEnumerable<Quote> history, int look
r.Rsi = 100;
}

r.IsIncreasing = (r.Rsi >= lastRSI) ? true : false;
r.IsIncreasing = (r.Rsi > lastRSI);
lastRSI = (float)r.Rsi;
}

Expand Down
2 changes: 1 addition & 1 deletion Indicators/Stochastic/Stoch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static IEnumerable<StochResult> GetStoch(IEnumerable<Quote> history, int
.Select(v => v.Oscillator)
.Average();

r.IsIncreasing = (r.Oscillator >= lastOsc) ? true : false;
r.IsIncreasing = (r.Oscillator > lastOsc);
lastOsc = (float)r.Oscillator;
}

Expand Down
2 changes: 1 addition & 1 deletion Indicators/StochasticRsi/StochRsi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static IEnumerable<StochRsiResult> GetStochRsi(IEnumerable<Quote> history
{
if (r.Index >= lookbackPeriod)
{
r.IsIncreasing = (r.StochRsi >= lastRSI) ? true : false;
r.IsIncreasing = (r.StochRsi > lastRSI);
}

lastRSI = r.StochRsi;
Expand Down

0 comments on commit 132b385

Please sign in to comment.