про борьбу я не подумал :)
теперь про перегрузки: могзи сначало закипели, потом сварились, а
когда стали поджариваться получилось это
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);