Mikhail Sukhov Можно прислать измененный пример с котированием для отладки?
namespace SampleGUI
{
using System;
using Ecng.Xaml;
using StockSharp.Algo;
using StockSharp.Algo.Strategies;
using StockSharp.BusinessEntities;
public class _Strategy : Strategy
{
public Security _SECURITY_future;
private MarketQuotingStrategy Quoting;
private MarketQuotingStrategy Close_Quoting;
private Order order_Sell;
private Order Close_order_Sell;
public _Strategy(Security SECURITY_future)
{
_SECURITY_future = SECURITY_future;
}
protected override void OnStarted()
{
_SECURITY_future.WhenMarketDepthChanged()
.Do(logic_Quoting).Once().Apply();
base.OnStarted();
}
private void logic_Quoting()
{
order_Sell = this.CreateOrder(OrderDirections.Sell, base.Security.BestAsk.Price, Volume);
Quoting = new MarketQuotingStrategy(order_Sell, new Unit(20), new Unit(-20))
{
Volume = 1,
Security = _SECURITY_future,
Trader = Trader,
Portfolio = Portfolio,
};
ChildStrategies.Add(Quoting);
Quoting.WhenStopped().Do(logic_Close).Once().Apply();
}
private void logic_Close()
{
Close_order_Sell = this.CreateOrder(OrderDirections.Buy, base.Security.BestBid.Price, Volume);
Close_Quoting = new MarketQuotingStrategy(Close_order_Sell, new Unit(20), new Unit(-20))
{
Volume = 1,
Security = _SECURITY_future,
Trader = Trader,
Portfolio = Portfolio,
};
ChildStrategies.Add(Close_Quoting);
Close_Quoting.WhenStopped().Do(logic_Quoting).Once().Apply();
}
}
}