Skip to content

Commit

Permalink
reduce Hurst minimum lookback (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshquack authored Dec 25, 2022
1 parent adc858f commit b070d41
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_indicators/Hurst.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ IEnumerable<HurstResult> results =

| name | type | notes
| -- |-- |--
| `lookbackPeriods` | int | Number of periods (`N`) in the Hurst Analysis. Must be greater than 100. Default is 100.
| `lookbackPeriods` | int | Number of periods (`N`) in the Hurst Analysis. Must be greater than 20. Default is 100.

### Historical quotes requirements

Expand Down
4 changes: 2 additions & 2 deletions src/e-k/Hurst/Hurst.Series.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ private static void ValidateHurst(
int lookbackPeriods)
{
// check parameter arguments
if (lookbackPeriods < 100)
if (lookbackPeriods < 20)
{
throw new ArgumentOutOfRangeException(nameof(lookbackPeriods), lookbackPeriods,
"Lookback periods must be at least 100 for Hurst Exponent.");
"Lookback periods must be at least 20 for Hurst Exponent.");
}
}
}
2 changes: 1 addition & 1 deletion tests/indicators/e-k/Hurst/Hurst.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ public void Removed()
[TestMethod]
public void Exceptions()
=> Assert.ThrowsException<ArgumentOutOfRangeException>(()
=> quotes.GetHurst(99));
=> quotes.GetHurst(19));
}

0 comments on commit b070d41

Please sign in to comment.