-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from AsyncAlgoTrading/momentum
Momentum strategy and fixes
- Loading branch information
Showing
22 changed files
with
632 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .engine import TradingEngine # noqa: F401 | ||
from .manager import StrategyManager # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .handler import EventHandler # noqa: F401 | ||
from .print import PrintHandler # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from .handler import EventHandler | ||
from ..models import Event | ||
|
||
|
||
class PrintHandler(EventHandler): | ||
######################### | ||
# Event Handler Methods # | ||
######################### | ||
def onTrade(self, event: Event): | ||
'''Called whenever a `Trade` event is received''' | ||
print(event) | ||
|
||
def onOrder(self, event: Event): | ||
'''Called whenever an Order `Open` event is received''' | ||
print(event) | ||
|
||
def onData(self, event: Event): | ||
'''Called whenever other data is received''' | ||
print(event) | ||
|
||
def onHalt(self, event: Event): | ||
'''Called whenever an exchange `Halt` event is received, i.e. an event to stop trading''' | ||
print(event) | ||
|
||
def onContinue(self, event: Event): | ||
'''Called whenever an exchange `Continue` event is received, i.e. an event to continue trading''' | ||
print(event) | ||
|
||
def onError(self, event: Event): | ||
'''Called whenever an internal error occurs''' | ||
print(event) | ||
|
||
def onStart(self, event: Event): | ||
'''Called once at engine initialization time''' | ||
print(event) | ||
|
||
def onExit(self, event: Event): | ||
'''Called once at engine exit time''' | ||
print(event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from .calculations import CalculationsMixin # noqa: F401 | ||
from .risk import RiskManager # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.