Reverted strategy to random buy/sell

This commit is contained in:
Michael Halls-Moore
2015-02-03 15:22:03 +00:00
parent b0b19d603d
commit 30dbcc7bfa
3 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -10,9 +10,8 @@ class TestRandomStrategy(object):
def calculate_signals(self, event):
if event.type == 'TICK':
self.ticks += 1
if self.ticks == 2:
if self.ticks % 2 == 0:
signal = SignalEvent(self.instrument, "market", "buy")
self.events.put(signal)
if self.ticks == 10:
else:
signal = SignalEvent(self.instrument, "market", "sell")
self.events.put(signal)
self.events.put(signal)