Skip to content

Commit

Permalink
Resolved review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JosueNina committed Dec 17, 2024
1 parent 4ddbf6b commit 7501578
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Algorithm/QCAlgorithm.Indicators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,8 @@ public SortinoRatio SORTINO(Symbol symbol, int sortinoPeriod, double minimumAcce
/// <param name="selector">Selects a value from the BaseData to send into the indicator. If null, defaults to the Value property of BaseData (x => x.Value).</param>
/// <returns>The configured Squeeze Momentum indicator.</returns>
[DocumentationAttribute(Indicators)]
public SqueezeMomentum SM(Symbol symbol, int bollingerPeriod = 20, decimal bollingerMultiplier = 2m, int keltnerPeriod = 20, decimal keltnerMultiplier = 1.5m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)
public SqueezeMomentum SM(Symbol symbol, int bollingerPeriod = 20, decimal bollingerMultiplier = 2m, int keltnerPeriod = 20,
decimal keltnerMultiplier = 1.5m, Resolution? resolution = null, Func<IBaseData, IBaseDataBar> selector = null)
{
var name = CreateIndicatorName(symbol, $"SM({bollingerPeriod}, {bollingerMultiplier}, {keltnerPeriod}, {keltnerMultiplier})", resolution);
var squeezeMomentum = new SqueezeMomentum(name, bollingerPeriod, bollingerMultiplier, keltnerPeriod, keltnerMultiplier);
Expand Down
4 changes: 3 additions & 1 deletion Indicators/SqueezeMomentum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using QuantConnect.Data.Market;

namespace QuantConnect.Indicators
Expand Down Expand Up @@ -52,13 +53,14 @@ public SqueezeMomentum(string name, int bollingerPeriod, decimal bollingerMultip
_bollingerBands = new BollingerBands(bollingerPeriod, bollingerMultiplier);
_averageTrueRange = new AverageTrueRange(keltnerPeriod, MovingAverageType.Simple);
_keltnerMultiplier = keltnerMultiplier;
WarmUpPeriod = Math.Max(bollingerPeriod, keltnerPeriod);
}

/// <summary>
/// Gets the warm-up period required for the indicator to be ready.
/// This is determined by the warm-up period of the Bollinger Bands indicator.
/// </summary>
public int WarmUpPeriod => _bollingerBands.WarmUpPeriod;
public int WarmUpPeriod { get; }

/// <summary>
/// Indicates whether the indicator is ready and has enough data for computation.
Expand Down

0 comments on commit 7501578

Please sign in to comment.