Стоп заявки
Atom
19.11.2010


Михаил, вечер добрый!
Помогите пожалуйста разобраться как через S# выставлять стоп-заявки.
Я Посылаю заявку и назначаю ей стоп. Но он почему-то не отображается в таблице стопов и соответственно не выставляется.

Код
double buyPrice = curPrice - _params.CoeffATRLevel * oneStep * i;
buyPrice = TraderHelper.ShrinkPrice(Security, buyPrice, ShrinkRules.Less);
myOrder.buyApp = BuyAt(buyPrice);
myOrder.buyApp.StopCondition = new QuikStopCondition{
Type=QuikStopConditionTypes.StopLimit,
            StopPrice=slBuy,
};
RegisterOrder(myOrder.buyApp);

Теги:


Спасибо:


Alexander

Фотография
Дата: 20.11.2010
Ответить


romanick
Михаил, вечер добрый!
Помогите пожалуйста разобраться как через S# выставлять стоп-заявки.
Я Посылаю заявку и назначаю ей стоп. Но он почему-то не отображается в таблице стопов и соответственно не выставляется.

Код
double buyPrice = curPrice - _params.CoeffATRLevel * oneStep * i;
buyPrice = TraderHelper.ShrinkPrice(Security, buyPrice, ShrinkRules.Less);
myOrder.buyApp = BuyAt(buyPrice);
myOrder.buyApp.StopCondition = new QuikStopCondition{
Type=QuikStopConditionTypes.StopLimit,
            StopPrice=slBuy,
};
RegisterOrder(myOrder.buyApp);



Вот моя функция из класса. Для фьючерса РТС, проскальзывание 1000пп задаю.

Код
protected void PlaceStrategyStop(OrderDirections direction, double stopPrice)
{
//TODO: изменить стопы на лимиты Security (изменять при изменении лимитов)

var price = direction == OrderDirections.Buy ? stopPrice + 1000 : stopPrice - 1000;

var newStopOrder = new Order
{
Portfolio = Portfolio,
Type = OrderTypes.Conditional,
Volume = Volume,
Security = Security,
Direction = direction,
Price = price,
StopCondition = new QuikStopCondition
{
Type = QuikStopConditionTypes.StopLimit,
StopPrice = stopPrice,
ExpiryDate = DateTime.MaxValue
}
};
RegisterOrder(newStopOrder);
}

Спасибо: romanick

romanick

Фотография
Дата: 20.11.2010
Ответить


Разобрался, спасибо!
Спасибо:


Добавить файлы через драг-н-дроп, , или вставить из буфера обмена.

loading
clippy