Вопрос по BasketStrategy

Вопрос по BasketStrategy
Atom
11/14/2011


Code
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().
Но если останавливается одна стратегия, другая почему-то не останавливается.
Может нужно их как-то по-другому останавливать?

Tags:


Thanks:


Alexander

Avatar
Date: 11/14/2011
Reply


Supervisor Go to
Code
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().
Но если останавливается одна стратегия, другая почему-то не останавливается.
Может нужно их как-то по-другому останавливать?


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

Supervisor

Avatar
Date: 11/14/2011
Reply


Разобрался, засунул обработчики в OnStopping() а не в Stop() и заработало [blush]
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy