Created
May 15, 2018 02:48
-
-
Save dev4Fun/42657f4253a85de05e9ba9c0a32a1044 to your computer and use it in GitHub Desktop.
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
from fasttrade.model.trade import TradeDetails | |
class ShortTrade(TradeDetails): | |
def __init__(self, start_price: float, symbol: str, amount: float, percent_change: float = 0.5, | |
currency: str = "USD") -> None: | |
super().__init__(start_price, symbol, amount, currency) | |
self.end_price = start_price * (1 - percent_change / 100) | |
@property | |
def exit_price(self): | |
return self.end_price | |
def __str__(self) -> str: | |
return "Short " + super().__str__() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment