Skip to content

Ignore Mac DS_Store #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,7 @@ launchSettings.json
**/keys.bin
dist/
data/**
!data/.gitkeep
!data/.gitkeep

## Mac specific
.DS_Store
25 changes: 14 additions & 11 deletions src/ExchangeSharp/Traders/MovingAverageCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public abstract class MovingAverageCalculatorBase<T>
protected T _previousMovingAverage;
protected T _previousExponentialMovingAverage;

public int WindowSize => _windowSize;

public T WeightingMultiplier => _weightingMultiplier;
/// <summary>
/// Current moving average
/// </summary>
Expand Down Expand Up @@ -58,6 +61,17 @@ public override string ToString()
{
return string.Format("{0}:{1}, {2}:{3}", MovingAverage, Slope, ExponentialMovingAverage, ExponentialSlope);
}

/// <summary>
/// Gets a value indicating whether enough values have been provided to fill the
/// specified window size. Values returned from NextValue may still be used prior
/// to IsMature returning true, however such values are not subject to the intended
/// smoothing effect of the moving average's window size.
/// </summary>
public bool IsMature
{
get { return _valuesIn == _windowSize; }
}
}

/// <summary>
Expand Down Expand Up @@ -126,17 +140,6 @@ public void NextValue(double nextValue)
}
}

/// <summary>
/// Gets a value indicating whether enough values have been provided to fill the
/// specified window size. Values returned from NextValue may still be used prior
/// to IsMature returning true, however such values are not subject to the intended
/// smoothing effect of the moving average's window size.
/// </summary>
public bool IsMature
{
get { return _valuesIn == _windowSize; }
}

/// <summary>
/// Clears any accumulated state and resets the calculator to its initial configuration.
/// Calling this method is the equivalent of creating a new instance.
Expand Down