Is it possible to implement the event delegation pattern between an indicator and a strategy?
If an indicator shows a trend change e.g. I will be informed in a running strategy.
I have tried this:
(indicator class, called "MyCallback")
...
public delegate void CallMe(string message);
...
...
public event CallMe CallHandler;
in the "OnBarUpdate"-method I send via event a message like this:
if(CallHandler != null)
{
CallHandler("something is going on");
}
in the strategy class I do this:
....
(Variables)
private MyCallback callBackMe;
protected override void Initialize()
{
callBackMe = new MyCallback();
callBackMe += new CallMe(this.GetCalled);
}
private void GetCalled(string message)
{
Print(...)
}
I think that is correct, but ther is no messag eat all!
Any idea?
Thanks a lot
Markus
Comment