October 2018
Beginner
362 pages
9h 32m
English
Let's start with the fundamental actions our platform could take on the market; we need it to be able to buy, sell, or hold stock:
import mathfrom time import timefrom enum import Enum
class TradingPosition(object): ''' Class that manages the trading position of our platform''' def __init__(self, code, buy_price, amount, next_price): self.code = code ## Status code for what action our algorithm is taking self.amount = amount ## The amount of the trade self.buy_price = buy_price ## The purchase price of a trade self.current_price = buy_price ## ...
Read now
Unlock full access