public void OnPrice_NotPriceSignal__ReturnsFalse()
 {
     SignalSelector.OnPrice(new Signal()
     {
         Type = SignalType.EnterOnOpen
     }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeFalse();
 }
 public void OnClose_CloseSignal__ReturnsTrue()
 {
     SignalSelector.OnClose(new Signal()
     {
         Type = SignalType.EnterOnClose
     }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeTrue();
 }
示例#3
0
 public void OnStopHit_NotCloseOnPrice__ReturnsFalse()
 {
     ClosingPositionSelector.OnStopHit(new Position()
     {
         CloseMode = PositionCloseMode.OnClose
     }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeFalse();
 }
示例#4
0
 public void OnClose_CloseOnClose__ReturnsTrue()
 {
     ClosingPositionSelector.OnClose(new Position()
     {
         CloseMode = PositionCloseMode.OnClose
     }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeTrue();
 }
 public void OnPrice(PositionDir positionDir, float price, float expected)
 {
     OpenPriceSelector.OnPrice(
         new Signal()
     {
         Direction = positionDir, Price = price
     },
         StockPricesDataUtils.CreatePricesData(10, 100, 5, 20),
         0).ShouldBe(expected);
 }
示例#6
0
 public void OnStopHit(PositionDir positionDir, float price, float expected)
 {
     ClosePriceSelector.OnStopHit(
         new Position()
     {
         Direction = positionDir, CloseModePrice = price
     },
         StockPricesDataUtils.CreatePricesData(10, 100, 5, 20),
         0).ShouldBe(expected);
 }
 public void OnPrice(PositionDir positionDir, float price, bool expected)
 {
     SignalSelector.OnPrice(
         new Signal()
     {
         Type = SignalType.EnterOnPrice, Direction = positionDir, Price = price
     },
         StockPricesDataUtils.CreatePricesData(0, 100, 50, 0),
         0).ShouldBe(expected);
 }
示例#8
0
 public void OnStopHit(PositionDir positionDir, float closeModePrice, bool expected)
 {
     ClosingPositionSelector.OnStopHit(
         new Position()
     {
         Direction = positionDir, CloseMode = PositionCloseMode.OnStopHit, CloseModePrice = closeModePrice
     },
         StockPricesDataUtils.CreatePricesData(0, 100, 50, 0),
         0).ShouldBe(expected);
 }
 public void OnClose__ReturnsClosePrice()
 {
     OpenPriceSelector.OnClose(new Signal(), StockPricesDataUtils.CreatePricesData(0, 0, 0, 10), 0).ShouldBe(10);
 }
 public void OnOpen__ReturnsOpenPrice()
 {
     OpenPriceSelector.OnOpen(new Signal(), StockPricesDataUtils.CreatePricesData(10, 0, 0, 0), 0).ShouldBe(10);
 }
示例#11
0
 public void OnClose__ReturnsClosePrice()
 {
     ClosePriceSelector.OnClose(new Position(), StockPricesDataUtils.CreatePricesData(0, 0, 0, 10), 0).ShouldBe(10);
 }
示例#12
0
 public void OnOpen__ReturnsOpenPrice()
 {
     ClosePriceSelector.OnOpen(new Position(), StockPricesDataUtils.CreatePricesData(10, 0, 0, 0), 0).ShouldBe(10);
 }