denis
|
Дата: 13.03.2010
|
|
|
|
квик-джуниор - рулит :)
стакана вообще не было :) судя по описанию MarketQuotingStrategy можно было сделать не выходя за пределы таблицы "инструменты", а вот с другими стратегиями такой фокус не пройдет теперь буду знать что нужен стакан и выводить нужно так
private void StartDde() { _isDdeStarted = true; _trader.StartDde(); _trader.StartDde(mysec + " Котировки" ); _trader.StartDde("папир"); _trader.StartDde("папир_фортс"); } а просто _trader.StartDde(lkoh); не идет, говорит что "окно LKOH не найдено"
сейчас переделал OnLog, там такое все разговорчивое оказывается private void OnLog(Strategy strategy, StrategyErrorStates errorState, string message) { // если стратегия вывела не просто сообщение, то вывести на экран. //if (errorState != StrategyErrorStates.None) // this.Sync(() => MessageBox.Show(this, message)); Console.WriteLine("[{0}] {1} => {2}", strategy.Id, errorState, message); }
[0] None => Quoting new order Buy with id 788915243 price 1566,99 volume 1 transaction 76 [0] Warning => Order 788915243 doesn't have a state [0] None => Quoting renewing order Buy with id 788915243 price 1566,99 volume 1 transaction 76 [0] None => Quoting renewed order Buy with id 788915281 price 1566,99 volume 1 transaction 77 [0] Warning => Order 788915281 doesn't have a state [0] Warning => Order 788915281 doesn't have a state [0] Warning => Order 788915281 doesn't have a state [0] None => Quoting renewing order Buy with id 788915281 price 1566,99 volume 1 transaction 77 [0] None => Quoting renewed order Buy with id 788915320 price 1566,99 volume 1 transaction 78 [0] Warning => Order 788915320 doesn't have a state [0] Warning => Order 788915320 doesn't have a state [0] None => Quoting renewing order Buy with id 788915320 price 1566,99 volume 1 transaction 78 [0] None => Quoting renewed order Buy with id 788915341 price 1566,99 volume 1 transaction 79 [0] Warning => Order 788915341 doesn't have a state [0] Warning => Order 788915341 doesn't have a state [0] None => Quoting renewing order Buy with id 788915341 price 1566,99 volume 1 transaction 79 [0] None => Quoting renewed order Buy with id 788915367 price 1566,99 volume 1 transaction 80 [0] Warning => Order 788915367 doesn't have a state [0] Warning => Order 788915367 doesn't have a state [0] Warning => Order 788915367 doesn't have a state [0] Warning => Order 788915367 doesn't have a state [0] Warning => Order 788915367 doesn't have a state [0] None => Quoting renewing order Buy with id 788915367 price 1566,99 volume 1 transaction 80 [0] None => Quoting renewed order Buy with id 788915436 price 1566,99 volume 1 transaction 81 [0] Warning => Order 788915436 doesn't have a state [0] Warning => Order 788915436 doesn't have a state [0] None => Quoting renewing order Buy with id 788915436 price 1566,99 volume 1 transaction 81 [0] None => Quoting renewed order Buy with id 788915468 price 1566,99 volume 1 transaction 82 [0] Warning => Order 788915468 doesn't have a state [0] Warning => Order 788915468 doesn't have a state [0] None => Quoting renewing order Buy with id 788915468 price 1566,99 volume 1 transaction 82 [0] None => Quoting renewed order Buy with id 788915490 price 1566,99 volume 1 transaction 83 [0] Warning => Order 788915490 doesn't have a state [0] Warning => Order 788915490 doesn't have a state [0] None => Quoting renewing order Buy with id 788915490 price 1566,99 volume 1 transaction 83 [0] None => Quoting renewed order Buy with id 788915524 price 1566,99 volume 1 transaction 84 [0] None => Quoting renewing order Buy with id 788915524 price 1566,99 volume 1 transaction 84 [0] None => Quoting renewed order Buy with id 788915538 price 1566,99 volume 1 transaction 85 [0] Warning => Order 788915538 doesn't have a state [0] Warning => Order 788915538 doesn't have a state [0] Warning => Order 788915538 doesn't have a state [0] None => Quoting renewing order Buy with id 788915538 price 1566,99 volume 1 transaction 85 [0] None => Quoting renewed order Buy with id 788915562 price 1566,99 volume 1 transaction 86 [0] Warning => Order 788915562 doesn't have a state [0] None => Quoting renewing order Buy with id 788915562 price 1566,99 volume 1 transaction 86 [0] None => Quoting renewed order Buy with id 788915581 price 1566,99 volume 1 transaction 87 [0] Warning => Order 788915581 doesn't have a state [0] Warning => Order 788915581 doesn't have a state [0] None => Quoting renewing order Buy with id 788915581 price 1566,99 volume 1 transaction 87
Вот что мне не понятно, так это почему происходит выставление и снятие по одной и той же цене? При неизменном стакане и спреде. Когда произошло изменение, то выставляется все верно и опять начинает скакать.
|
denis
|
Дата: 14.03.2010
|
|
|
|
про борьбу я не подумал :) теперь про перегрузки: могзи сначало закипели, потом сварились, а когда стали поджариваться получилось это class my_MarketQuotingStrategy : MarketQuotingStrategy { public my_MarketQuotingStrategy(ITrader trader, Order order, TimeSpan interval, bool isForts, MarketPriceTypes priceType, Unit priceDelta) : base(trader, order, interval, isForts, priceType, priceDelta) { Console.WriteLine("dgdfg"); } protected override bool IsNeedReRegister() { Console.WriteLine("this.Order.Price={0}, GetNewPrice()={1}", this.Order.Price, GetNewPrice()); return this.Order.Price != GetNewPrice(); } } поскольку я полный чайник, то даже не могу понять чего я сделал, но на вывод получил это [0] None => ChStrategy runned "SampleSMA.vshost.exe" (управляемый): "C:\WINDOWS\assembly\GAC_MSIL \System.Runtime.Serialization \3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" загружен, загрузка символов пропущена. Модуль оптимизирован, включен режим отладки "Только мой код". dgdfg this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 ...скип... this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1595 this.Order.Price=1595, GetNewPrice()=1602,32 [0] None => Quoting new order Buy price 1602,31 volume 1 [0] None => Quoting new order Buy with id 789112783 price 1602,31 volume 1 transaction 1 this.Order.Price=1602,31, GetNewPrice()=1595 [0] Warning => Order 789112783 doesn't have a state this.Order.Price=1602,31, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112783 price 1602,31 volume 1 transaction 1 [0] None => Quoting renewed order Buy with id 789112810 price 1602,3 volume 1 transaction 2 this.Order.Price=1602,3, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112810 price 1602,3 volume 1 transaction 2 [0] None => Quoting renewed order Buy with id 789112839 price 1594,99 volume 1 transaction 3 this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112839 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112839 price 1594,99 volume 1 transaction 3 [0] None => Quoting renewed order Buy with id 789112856 price 1594,99 volume 1 transaction 4 this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112856 price 1594,99 volume 1 transaction 4 [0] None => Quoting renewed order Buy with id 789112872 price 1594,99 volume 1 transaction 5 this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112872 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112872 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112872 price 1594,99 volume 1 transaction 5 [0] None => Quoting renewed order Buy with id 789112893 price 1594,99 volume 1 transaction 6 this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112893 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112893 price 1594,99 volume 1 transaction 6 [0] None => Quoting renewed order Buy with id 789112913 price 1594,99 volume 1 transaction 7 this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112913 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112913 price 1594,99 volume 1 transaction 7 [0] None => Quoting renewed order Buy with id 789112935 price 1594,99 volume 1 transaction 8 this.Order.Price=1594,99, GetNewPrice()=1595 [0] None => Quoting renewing order Buy with id 789112935 price 1594,99 volume 1 transaction 8 [0] None => Quoting renewed order Buy with id 789112948 price 1594,99 volume 1 transaction 9 this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112948 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595 [0] Warning => Order 789112948 doesn't have a state this.Order.Price=1594,99, GetNewPrice()=1595
и так далее, много-много раз т.е. выставление купли происходит на тик хуже лучшего бида, а поскольку оно не равно, то надо переставить... задать отступ не могу, там только на чтение // регистрируем на котирование var strategy = new my_MarketQuotingStrategy(base.Trader, order, base.Interval, false, MarketPriceTypes.Following, new Unit());
strategy.Start(); base.ChildStrategies.Add(strategy);
|