I am getting this error:
'string' does not contain a definition for 'MasterInstrument' and no extension method 'MasterInstrument' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
with this code
#region Variables
// parameters
private bool draw = false;
// user variables
private bool FirstTime = true;
private string ThisAlert;
private string Instrument;
private string Interval;
private string Period;
#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()
{
}
/// <summary>
/// OnBarUpdate
/// </summary>
protected override void OnBarUpdate()
{
if (FirstTime)
{
FirstTime = false;
Instrument = Instrument.MasterInstrument.Name;
Interval = BarsPeriod.Id.ToString();
Period = BarsPeriod.Value.ToString();
ThisAlert =
Instrument.MasterInstrument.Name
+ "."
+ BarsPeriod.Id.ToString()
+ "."
+ BarsPeriod.Value.ToString();
Print (ThisAlert);
}
}
Comment