Неправильно срабатывает LastTradePriceLess

Неправильно срабатывает LastTradePriceLess
Atom
10/6/2011
frontman


Использую правило:

this.When(Security.LastTradePriceLess(StopProtectiveDelta))
                   .Do(() => 
                       AddedStopOrder(OrderDirections.Sell))
                   .Once();

Но стоп не ждет, пока цена пройдет StopProtectiveDelta, а сразу же выставляет заявку (цену заявки указывает верно, с учетом стопа и проскальзывания). Подскажите, в чем может быть проблема? Моя ошибка или ошибка в работе правила?


Tags:


Thanks:


< 1 2 3 4  >
frontman

Avatar
Date: 10/6/2011
Reply


Используется LastTradePriceLessAbsolute и LastTradePriceMoreAbsolute

Thanks:

Alexander

Avatar
Date: 10/6/2011
Reply


frontman: Используется LastTradePriceLessAbsolute и LastTradePriceMoreAbsolute

Покажите создание и вывод. Где что выводится? вывод одинаков что для LastTradePriceMoreAbsolute, что для LastTradePriceLessAbsolute

Thanks:

frontman

Avatar
Date: 10/6/2011
Reply


        ```csharp

this.AddInfoLog("Порог цены: {0}", stopPrice); if (Trade.Order.Direction == OrderDirections.Buy) { this.AddInfoLog("Цена на момент создания правила: {0}", Security.LastTrade.Price); this.When(Security.LastTradePriceLessAbsolute(stopPrice)) .Do(() => { this.AddInfoLog("Цена на момент срабатывания правила: {0}", Security.LastTrade.Price); AddedStopOrder(OrderDirections.Sell); }) .Once(); } else { this.AddInfoLog("Цена на момент создания правила: {0}", Security.LastTrade.Price); this.When(Security.LastTradePriceMoreAbsolute(stopPrice)) .Do(() => { this.AddInfoLog("Цена на момент срабатывания правила: {0}", Security.LastTrade.Price); AddedStopOrder(OrderDirections.Buy); }) .Once(); }

Thanks:

Alexander

Avatar
Date: 10/6/2011
Reply


Сделайте разную печать. Такое впечатление что срабатывает оба раза LastTradePriceLessAbsolute. И срабатывает понятное дело правильно.

Thanks:

frontman

Avatar
Date: 10/6/2011
Reply


16:21:03.294 | | PS | Порог цены: 15158,00000 16:21:03.294 | | PS | Цена на момент создания правила LastTradePriceMoreAbsolute: 15148,00000 16:21:03.310 | | PS | Цена на момент срабатывания правила LastTradePriceMoreAbsolute: 15149,00000

16:21:13.778 | | PS | Стратегия запущена. 16:21:13.778 | | PS | Порог цены: 15165,00000 16:21:13.778 | | PS | Цена на момент создания правила LastTradePriceMoreAbsolute: 15155,00000 16:21:13.778 | | PS | Цена на момент срабатывания правила LastTradePriceMoreAbsolute: 15158,00000

16:21:14.669 | | PS | Порог цены: 15145,00000 16:21:14.669 | | PS | Цена на момент создания правила LastTradePriceLessAbsolute: 15155,00000 16:21:14.669 | | PS | Цена на момент срабатывания правила LastTradePriceLessAbsolute: 15154,00000

Thanks:

frontman

Avatar
Date: 10/6/2011
Reply


this.AddInfoLog("Порог цены: {0}", stopPrice);
            if (Trade.Order.Direction == OrderDirections.Buy)
            {
                this.AddInfoLog("Цена на момент создания правила LastTradePriceLessAbsolute: {0}", Security.LastTrade.Price);
                this.When(Security.LastTradePriceLessAbsolute(stopPrice))
                    .Do(() =>
                            {
                                this.AddInfoLog("Цена на момент срабатывания правила LastTradePriceLessAbsolute: {0}", Security.LastTrade.Price);
                                AddedStopOrder(OrderDirections.Sell);
                            })
                    .Once();
            }
            else
            {
                this.AddInfoLog("Цена на момент создания правила LastTradePriceMoreAbsolute: {0}", Security.LastTrade.Price);
                this.When(Security.LastTradePriceMoreAbsolute(stopPrice))
                    .Do(() =>
                            {
                                this.AddInfoLog("Цена на момент срабатывания правила LastTradePriceMoreAbsolute: {0}", Security.LastTrade.Price);
                                AddedStopOrder(OrderDirections.Buy);
                            })
                    .Once();
            }
Thanks:

Alexander

Avatar
Date: 10/7/2011
Reply


Вроде исправил. в 4.0.2 будет.

Thanks:

frontman

Avatar
Date: 10/7/2011
Reply


Благодарю. А не могли бы вы хотя бы примерно расписать причины? Ну так для расширения так сказать кругозора)

Thanks:

Alexander

Avatar
Date: 10/7/2011
Reply


frontman: Благодарю. А не могли бы вы хотя бы примерно расписать причины? Ну так для расширения так сказать кругозора)

Какой ответ ожидаете? :) Ошибка при разработке логического характера.

Thanks:

frontman

Avatar
Date: 10/7/2011
Reply


) Ну понял) В принципе согласен с вами не видя исходников врятли я что то пойму)

Thanks:
< 1 2 3 4  >

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

loading
clippy