Skip to content

Instantly share code, notes, and snippets.

@mattbarrett
Created May 5, 2014 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbarrett/035034b93cd7c16ded93 to your computer and use it in GitHub Desktop.
Save mattbarrett/035034b93cd7c16ded93 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment