← Zurück

Вопрос по BasketStrategy

var basket = new BasketStrategy(BasketStrategyFinishModes.First);
basket.ChildStrategies.Add(new MyTakeProfitStrategy(this, trade, tp));
basket.ChildStrategies.Add(new MyStopLossStrategy(this, trade, sl));
ChildStrategies.Add(basket);

MyTakeProfitStrategy и MyStopLossStrategy при срабатывании самоостанавливаются через Stop(). Но если останавливается одна стратегия, другая почему-то не останавливается. Может нужно их как-то по-другому останавливать?

War dieses Thema hilfreich?

Thema teilen

Kommentare (2)

Anmelden oder Konto erstellen, Melden Sie sich an oder registrieren Sie sich, um einen Kommentar zu hinterlassen

Alexander
Alexander

Supervisor: ... MyTakeProfitStrategy и MyStopLossStrategy при срабатывании самоостанавливаются через Stop(). Но если останавливается одна стратегия, другая почему-то не останавливается. Может нужно их как-то по-другому останавливать?

Чему равно FirstFinishStrategy в момент остановки? Вызывается ли OnStopping у второй стратегии?

Supervisor
Supervisor Autor

Разобрался, засунул обработчики в OnStopping() а не в Stop() и заработало 😊