Ladder - hook up show order ticket, modify order
This commit is contained in:
1 parent
6b4c44c9d6
commit
361b15b7fd
3 files changed
+6
-16
No files matched your search
@@ -53,6 +53,7 @@ namespace mbts.spark {
|
||||
_selected_order_type = backing(nameof(selected_order_type), Order.Types.TimeInForce.Day);
|
||||
algo_types = OrderDataHelper.Defaults.Algos.SelectMany(wrap_order).ToArray();
|
||||
_revert = backing(nameof(revert), false);
|
||||
show_ticket_command = new DelegateCommand(show_ticket);
|
||||
|
||||
// Orders
|
||||
_internal_orders = new ObservableCollection<OrderBookEntry>();
|
||||
@@ -129,23 +130,12 @@ namespace mbts.spark {
|
||||
|
||||
public ICommand cancel_command { get; }
|
||||
public ICommand send_order_command { get; }
|
||||
public ICommand show_ticket_command { get; }
|
||||
|
||||
internal void show_ticket(object _) {
|
||||
var bmp = new System.Windows.Media.Imaging.BitmapImage();
|
||||
bmp.BeginInit();
|
||||
bmp.UriSource = new Uri("http://edge-qa2/OrderTicket.png");
|
||||
bmp.EndInit();
|
||||
new System.Windows.Window() {
|
||||
Width = 255,
|
||||
Height = 177,
|
||||
Content = new System.Windows.Controls.Image() {
|
||||
Source = bmp
|
||||
}
|
||||
}.Show();
|
||||
internal void show_ticket() {
|
||||
_model.order_gateway.show_order_ticket(_order_template.Clone());
|
||||
}
|
||||
|
||||
public ICommand show_ticket_command => new DelegateCommand(show_ticket);
|
||||
|
||||
public void send_order((double price,Side? side) args) {
|
||||
if (args.side.HasValue) {
|
||||
Order order = _order_template.Clone();
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace mbts.spark {
|
||||
|
||||
public ICommand shatter_command => new DelegateCommand(_ => model.order_gateway.shatter(_order.order().Id), _ => !has_parent);
|
||||
public ICommand cancel_command => new DelegateCommand(_ => model.order_gateway.cancel_order(new OrderID[] {_order.order().Id}), _ => !has_parent);
|
||||
public ICommand modify_command => new DelegateCommand(_parent.show_ticket, _ => !has_parent);
|
||||
public ICommand modify_command => new DelegateCommand(() => model.order_gateway.show_order_modify(_order.order().Clone()), () => !has_parent);
|
||||
|
||||
public Brush foreground => Brushes.Black;
|
||||
public Brush background { get; private set; }
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace mbts.spark
|
||||
public IObservable<int> security_position(SecurityKey key) { return _positions_demuxer.subscribe(key).DistinctUntilChanged(); }
|
||||
public void show_ladder(Security security) { _bus.post(ShowLadderTag, new ShowLadderMessage(security)); }
|
||||
public void show_order_modify(Order order) { _bus.post(ShowOrderModifyTag, new ShowOrderModifyMessage(order)); }
|
||||
public void show_order_ticket(Order order) { _bus.post(ShowOrderTicketTag, new ShowOrderTicketMessage(order)); }
|
||||
public void show_order_ticket(Order order) { _orders_model.show_order_ticket(order); }
|
||||
public void set_securities(IEnumerable<Security> securities) { _securities_subject.OnNext(new HashSet<SecurityKey>(securities.Select(s => s.Id))); }
|
||||
public void Dispose() {
|
||||
Disposable.dispose(_subs);
|
||||
|
||||
Reference in new issue
Block a user