protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Linie"));
Add(PeriodType.Week, 1);
Overlay = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired)
return;
double mom1 = Momentum(Closes[1],28)[0];
double smamom = SMA(Momentum(Closes[1],28),28)[0];
if (mom1 > smamom)
Linie.Set(1);
else if (mom1 < smamom)
Linie.Set(-1);
else Linie.Set(0);

Comment