Подскажите, пожалуйста, возможно ли в своем правиле передать при активации какой-ли объект в метод Do (по аналогии с тем как правило SecurityNewTrades передает коллекцию сделок)? Метод Activate не принимает параметров и ничего не возвращает...
sealed class PeakRule : StrategyRule
{
public PeakRule(IExtremumStrategy strategy)
{
if (strategy == null)
throw new ArgumentNullException("strategy");
this.Strategy = strategy;
this.Strategy.NewPeak += OnPeak;
}
private IExtremumStrategy Strategy { get; set; }
private void OnPeak(PricePoint p)
{
//КАК ЗДЕСЬ ПЕРЕДАТЬ p?????
base.Activate();
}
protected override void DisposeManaged()
{
this.Strategy.NewPeak -= OnPeak;
base.DisposeManaged();
}
}
Kommentare (1)
Anmelden oder Konto erstellen, Melden Sie sich an oder registrieren Sie sich, um einen Kommentar zu hinterlassen
sealed class PeakRule : StrategyRule<PricePoint> { public PeakRule(IExtremumStrategy strategy) { if (strategy == null) throw new ArgumentNullException("strategy");