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();
 }
Esempio n. 3
0
 public void OnStopHit_NotCloseOnPrice__ReturnsFalse()
 {
     ClosingPositionSelector.OnStopHit(new Position()
     {
         CloseMode = PositionCloseMode.OnClose
     }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeFalse();
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 11
0
 public void OnClose__ReturnsClosePrice()
 {
     ClosePriceSelector.OnClose(new Position(), StockPricesDataUtils.CreatePricesData(0, 0, 0, 10), 0).ShouldBe(10);
 }
Esempio n. 12
0
 public void OnOpen__ReturnsOpenPrice()
 {
     ClosePriceSelector.OnOpen(new Position(), StockPricesDataUtils.CreatePricesData(10, 0, 0, 0), 0).ShouldBe(10);
 }