Calculate moving average on price change rather than on bar close

This commit is contained in:
moshferatu 2024-06-07 06:11:26 -07:00
parent c564ee3fe2
commit de3397870e

View File

@ -1,13 +1,9 @@
#region Using declarations #region Using declarations
using System;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Windows.Media; using System.Windows.Media;
using System.Xml.Serialization; using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui; using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.NinjaScript;
#endregion #endregion
// Do not change the namespace. // Do not change the namespace.
@ -21,8 +17,9 @@ namespace NinjaTrader.NinjaScript.Indicators
{ {
if (State == State.SetDefaults) if (State == State.SetDefaults)
{ {
Description = "Simple moving average indicator"; Description = "Basic moving average indicator";
Name = "Moving Average"; Name = "Moving Average";
Calculate = Calculate.OnPriceChange;
IsOverlay = true; IsOverlay = true;
IsSuspendedWhileInactive = true; IsSuspendedWhileInactive = true;
Period = 20; Period = 20;