Skip to content

Commit c7f2db5

Browse files
authored
Ignore Mac DS_Store (#598)
* 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.
1 parent 3aff3e6 commit c7f2db5

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,4 +456,7 @@ launchSettings.json
456456
**/keys.bin
457457
dist/
458458
data/**
459-
!data/.gitkeep
459+
!data/.gitkeep
460+
461+
## Mac specific
462+
.DS_Store

src/ExchangeSharp/Traders/MovingAverageCalculator.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public abstract class MovingAverageCalculatorBase<T>
3030
protected T _previousMovingAverage;
3131
protected T _previousExponentialMovingAverage;
3232

33+
public int WindowSize => _windowSize;
34+
35+
public T WeightingMultiplier => _weightingMultiplier;
3336
/// <summary>
3437
/// Current moving average
3538
/// </summary>
@@ -58,6 +61,17 @@ public override string ToString()
5861
{
5962
return string.Format("{0}:{1}, {2}:{3}", MovingAverage, Slope, ExponentialMovingAverage, ExponentialSlope);
6063
}
64+
65+
/// <summary>
66+
/// Gets a value indicating whether enough values have been provided to fill the
67+
/// specified window size. Values returned from NextValue may still be used prior
68+
/// to IsMature returning true, however such values are not subject to the intended
69+
/// smoothing effect of the moving average's window size.
70+
/// </summary>
71+
public bool IsMature
72+
{
73+
get { return _valuesIn == _windowSize; }
74+
}
6175
}
6276

6377
/// <summary>
@@ -126,17 +140,6 @@ public void NextValue(double nextValue)
126140
}
127141
}
128142

129-
/// <summary>
130-
/// Gets a value indicating whether enough values have been provided to fill the
131-
/// specified window size. Values returned from NextValue may still be used prior
132-
/// to IsMature returning true, however such values are not subject to the intended
133-
/// smoothing effect of the moving average's window size.
134-
/// </summary>
135-
public bool IsMature
136-
{
137-
get { return _valuesIn == _windowSize; }
138-
}
139-
140143
/// <summary>
141144
/// Clears any accumulated state and resets the calculator to its initial configuration.
142145
/// Calling this method is the equivalent of creating a new instance.

0 commit comments

Comments
 (0)