Sender indicator:
public class mySender : Indicator
{
private Series<double> MySeries;
private double exposedVariable;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
.
.
.
AddPlot(new Stroke(Brushes.Cyan, 3), PlotStyle.Line, "MyLine");
MySeries = new Series<double>(this);
//MyBool = false;
protected override void OnBarUpdate()
{
if (CurrentBar < 2)
{
return;
}
MySeries[0] = (Open[0] + Close[0])/2;
MyLine[0] = SMA(MySeries,10)[0];
exposedVariable = MyLine[0];
}
public double ExposedVariable
{
get { Update(); return exposedVariable; }
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> MyLine
{
get { return Values[0]; }
}
/*
[NinjaScriptProperty]
[Display(Name = "My Bool", Order = 1, GroupName = "Settings")]
[XmlIgnore]
public bool MyBool
{ get; set; }
*/
​
#endregion
Receiver Indicator:
protected override void OnBarUpdate()
{
Print(mySender().ExposedVariable);
}​
Both indicators are working fine. However, when I removed the comments to add MyBool into the code, I get the error from the receiver indicator:
No overload for method 'mySender' takes 0 arguments
I would appreciate assistance to explain what went wrong and what I can do to make it run correctly.

Comment