fix: bug fix now sell works

This commit is contained in:
arham committed 2026-08-05 15:47:21 -04:00
1 parent 3fd749dcd9
commit 400981738f
3 files changed
+3 -10

No files matched your search

@@ -88,9 +88,7 @@ namespace bts.shell {
new OrderTicketLadder() {
DataContext = new NewOrderTicketLadderVM(
_model, smd, accounts_src, settings_src,
ladderSecurity => _bus.post(SparkTags.ShowLadderTag, ladderSecurity)) {
CloseOnSend = _close_on_send
}
ladderSecurity => _bus.post(SparkTags.ShowLadderTag, ladderSecurity))
};
}
@@ -22,7 +22,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
class NewOrderTicketLadderVM : DisposableViewModelBase, IRequestViewClose {
class NewOrderTicketLadderVM : DisposableViewModelBase {
const ushort numPriceLevels = 5;
readonly Property<SecurityImmutable> security;
@@ -119,8 +119,6 @@ class NewOrderTicketLadderVM : DisposableViewModelBase, IRequestViewClose {
bool quantityValid = SizeCalculator.validate();
if (priceValid && quantityValid && !HasErrors && !PropertiesVm.HasErrors) {
model.send_order(Security, PropertiesVm.create(side), Price, SizeCalculator.value!.Value).ignore();
if (CloseOnSend)
RequestClose?.Invoke(this, new EventArgs());
}
}
@@ -149,8 +147,6 @@ class NewOrderTicketLadderVM : DisposableViewModelBase, IRequestViewClose {
}
}
public event EventHandler? RequestClose;
public SecurityImmutable Security => security.Value;
public string Title => Security.ToString() ?? string.Empty;
public double Price { get; set; }
@@ -166,7 +162,6 @@ class NewOrderTicketLadderVM : DisposableViewModelBase, IRequestViewClose {
public OrderPropertiesEditorVM PropertiesVm { get; }
public ObservableCollection<OrderTicketLadderPriceLevelVM> Bids => bids;
public ObservableCollection<OrderTicketLadderPriceLevelVM> Asks => asks;
public bool CloseOnSend { get; set; }
public ICommand SendOrderCmd { get; }
public ICommand SetPriceCmd { get; }
public ICommand ShowLadderCmd { get; }
@@ -317,7 +317,7 @@
<RadioButton
Grid.Column="1"
GroupName="Side"
IsChecked="{Binding IsBuy, Converter={StaticResource SideToIsSellConverter}}"
IsChecked="{Binding Side, Converter={StaticResource SideToIsSellConverter}}"
Style="{StaticResource SellRadioButtonStyle}">
<TextBlock FontWeight="Bold" Foreground="{u:BTSBrush UI.default_text}">
Sell