public void OnStalePrice() { _executablePrice = null; BigFigures = string.Empty; Pips = string.Empty; TenthOfPip = string.Empty; _executeCommand.RaiseCanExecuteChanged(); }
public void OnPrice(IExecutablePrice executablePrice) { _executablePrice = executablePrice; var formattedPrice = PriceFormatter.GetFormattedPrice(_executablePrice.Rate, executablePrice.Parent.CurrencyPair.RatePrecision, executablePrice.Parent.CurrencyPair.PipsPosition); BigFigures = formattedPrice.BigFigures; Pips = formattedPrice.Pips; TenthOfPip = formattedPrice.TenthOfPip; _executeCommand.RaiseCanExecuteChanged(); }
public IObservable <IStale <ITrade> > ExecuteRequest(IExecutablePrice executablePrice, long notional, string dealtCurrency) { var price = executablePrice.Parent; var request = new TradeRequestDto { Direction = executablePrice.Direction == Direction.BUY ? DirectionDto.Buy : DirectionDto.Sell, Notional = notional, SpotRate = executablePrice.Rate, Symbol = price.CurrencyPair.Symbol, ValueDate = price.ValueDate, DealtCurrency = dealtCurrency }; return(_executionServiceClient.ExecuteRequest(request) .Select(_tradeFactory.Create) .DetectStale(TimeSpan.FromSeconds(2), _concurrencyService.TaskPool)); }
public IObservable<IStale<ITrade>> ExecuteRequest(IExecutablePrice executablePrice, long notional, string dealtCurrency) { var price = executablePrice.Parent; var request = new TradeRequestDto { Direction = executablePrice.Direction == Direction.BUY ? DirectionDto.Buy : DirectionDto.Sell, Notional = notional, SpotRate = executablePrice.Rate, Symbol = price.CurrencyPair.Symbol, ValueDate = price.ValueDate, DealtCurrency = dealtCurrency }; return _executionServiceClient.ExecuteRequest(request) .Select(_tradeFactory.Create) .DetectStale(TimeSpan.FromSeconds(2), _concurrencyService.TaskPool); }
void ExecuteTrade(IPrice price, IExecutablePrice executablePrice, WKInterfaceLabel label) { if (price == null) { throw new ArgumentNullException("price"); } if (price == null || price.IsStale || _executing) { return; } _executing = true; label.SetText("Executing..."); executablePrice.ExecuteRequest(100930, _pair.BaseCurrency) .Subscribe(result => { _executing = false; ShowConfirmation(result.Update); label.SetText(""); }) .Add(_disposables); }
public void OnPrice(IExecutablePrice executablePrice) { }
public IObservable<IStale<ITrade>> ExecuteRequest(IExecutablePrice executablePrice, long notional, string dealtCurrency) { throw new NotImplementedException("Can't execute on LimitedNotificationTrader"); }
public IObservable <IStale <ITrade> > ExecuteRequest(IExecutablePrice executablePrice, long notional, string dealtCurrency) { throw new NotImplementedException("Can't execute on LimitedNotificationTrader"); }