Hi guys,
I just want to get the value of the MOMP to use in my algorithm.
I think (I am pretty sure) it has something to do with RollingWindow, but I am honestly a bit confused with the explanation in the documentation.
I have pulled/manipulated some code snippets below. Can anyone let me know if I am on the right track?
My big question is commented on the right of the first line after //OnData in the code below. Thanks!Alix//RollingWindow Class
private RollingWindow<IndicatorDataPoint> _mompWin;
//Initialize
.
.
//Indicators
MOMP(_symbol, 20).Updated += (sender, updated) => _mompWin.Add(updated);
_mompWin = new RollingWindow<IndicatorDataPoint>(20);
_selectorIndicators = new Indicators
{
MOMP = MOMP(_symbol, 20, Resolution.Daily, Field.Low)
}
//OnData
var currMomp = _mompWin[0]; //Does this give me the current MOMP value as a decimal?
decimal mompTrig = -2.5;
if (!Portfolio.Invested && currMomp < mompTrig)
{
SetHoldings(_symbol, 1);
}