Buy/Sell panel set

Screenshot: set of quick trading panels

BuySellGrid - a container of several BuySellPanel panels - one per security. It allows trading several securities from a single screen.

Main properties

Panels are added by BuySellGrid.AddPanel and removed by BuySellGrid.RemovePanel. The container does not register orders - it raises OrderRegistering with the security, portfolio, side, price and volume. The set of panels is persisted and restored by Save and Load.

Below are code snippets showing its usage:

<Window x:Class="Sample.BuySellWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:xaml="http://schemas.stocksharp.com/xaml"
	Height="400" Width="900">
	<xaml:BuySellGrid x:Name="BuySellGrid" />
</Window>
// Set the data sources for all panels
BuySellGrid.SecurityProvider = _connector;
BuySellGrid.MarketDataProvider = _connector;
BuySellGrid.Portfolios = new PortfolioDataSource(_connector);

// Add a panel for the security
BuySellGrid.AddPanel(_security);

// Register the order built by the panel
BuySellGrid.OrderRegistering += (security, portfolio, side, price, volume) =>
{
	_connector.RegisterOrder(new Order
	{
		Security = security,
		Portfolio = portfolio,
		Side = side,
		Price = price,
		Volume = volume,
	});
};

See also

Trading