How can I add these 2 Moving averages (both are SMA but with different periods) to the parameters section, so I can modify them and optimize them easily:
{
#region Variables
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Overlay = true;
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (SMA(20)[0] > SMA(50)[0])
BackColor = Color.Green;
if (SMA(20)[0] < SMA(50)[0])
BackColor = Color.Pink;
}
Thanks,
Alan
Comment