Skip to content

Commit

Permalink
Ignore Mac DS_Store (#598)
Browse files Browse the repository at this point in the history
* Update .gitignore

Navigating to a folder using the "Finder" on Mac generates a .DS_Store file holding metadata about the folder (e.g. thumbnails etc.). These files can pollute your git commits and are annoying.

* Update MovingAverageCalculator.cs

Pull methods and expose accessors on base class for consistency.
  • Loading branch information
jdx-john authored Jun 14, 2021
1 parent 3aff3e6 commit c7f2db5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
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

0 comments on commit c7f2db5

Please sign in to comment.