you actually achieve the opposite than what you wanted. Your code snippets show you want to specialize functions and events instead of keeping things as open and flexible as possible. Not sure whether you ever heard of a "state machine", but thats something that you may want to google and look up.
Quote from januson:
The purpose is to override OnBarUpdated with some custom code.. It could be reading some indicator value defined in the StartUp, that of course is automatically updated.. So for instance:
protected override void OnBarUpdated(Common.Entities.IBarData barData)
{
if(barData.Open.CrossAbove(sma9.Current))
BuyOnNextBar();
}
-- or something like that.. syntax that still needs thinking..
I should mention that OnBarUpdated is triggered by en event in the base class Strategy, the event is raised each time a tick/ trade is processed/ aggregated into another interval.
There will also be an event for OnTickReceived, that we could do something with.
