I am writing an Indicator, which is using (hosting) another indicator ... I want the hosted indicator to also Plot, however this doesn't happen.
(it works when it is a Strategy hosting an Indicator, once Add() is used onto the hosted indicator ... but I cannot get Add() to accept another Indicator from inside the hosting Indicator).
Thanks
public class UsePlotInput : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#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()
{
Add( SMA( Close, 20) ); // this doesn't compile ... but without it it doesn't plot the SMA
Overlay = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
SMA( Close, 20);
}
}
Comment