def __init__(self, mode): # In case of any errors self.error = False # Display Header display_header() # Bot mode self.mode = mode # Constants self.PERIOD = 14 self.HIGH = 80 self.LOW = 20 self.MFI_MARGIN = 3 # Assign variables self.symbol = enter_data() if self.mode == 'active': # Setup Plot plt.style.use('seaborn') self.fig, (self.ax1, self.ax2) = plt.subplots(2, 1) # Account references self.__orders = Orders() self.__account = Account() self.__market = Market() # Dataframe to store data self.df = pd.DataFrame() # Qty to purchase self.QTY = 1000 # Tracks position status self.in_position = False # Keeps track of the buying price self.buy_price = 0 # Init websocket self.ws = WebSocket(self) # Setup the plot's process self.p = Process(target=self.plot_live_graph) elif self.mode == 'test': self.hist_df = pd.DataFrame() self.mfi = None
def __init__(self, mode): # Set bot mode self.mode = mode # In case something goes wrong self.error = False # Period over which calculations will be made self.PERIOD = 20 # Display header display_header() # Enter asset self.symbol = enter_data() if self.mode == 'active': # Setup Plot plt.style.use('seaborn') self.fig, self.ax = plt.subplots() # Account references self.__orders = Orders() self.__account = Account() self.__market = Market() # Dataframe to store data self.df = pd.DataFrame() # Qty to purchase self.QTY = 1000 # Track buy price self.buy_price = 0 # Tracks position status self.in_position = False # Tracks the close prices self.closes = [] # Init websocket self.ws = WebSocket(self) # Setup the plot's process self.p = Process(target=self.plot_live_graph) elif self.mode == 'test': # self.position = False self.hist_df = pd.DataFrame()
def __init__(self, mode): # In case of any error self.error = False # Bot mode self.mode = mode # Display Header display_header() self.symbol = enter_data() if self.mode == 'active': # Setup Plot plt.style.use('seaborn') self.fig, self.ax = plt.subplots() # Account references self.__orders = Orders() self.__account = Account() self.__market = Market() # Dataframe to store data self.df = pd.DataFrame() # Qty to purchase self.QTY = 50 # Tracks position status self.in_position = False # Tracks the close prices self.closes = [] # Init websocket self.ws = WebSocket(self) # Track buy price self.buy_price = 0 # Setup the plot's process self.p = Process(target=self.plot_live_graph) elif self.mode == 'test': self.hist_df = pd.DataFrame() else: print('Weird!')
def __init__(self): # Period over which calculations will be made self.PERIOD = 20 # Display header display_header() # Enter asset self.symbol = enter_data() self.counter = 0 self.buy_price = 0 # Setup Plot plt.style.use('seaborn') self.fig, self.ax = plt.subplots() # Account references self.__orders = Orders() self.__account = Account() self.__market = Market() # Dataframe to store data self.df = pd.DataFrame() # Qty to purchase self.QTY = 3000 # Tracks position status self.in_position = False # Tracks the close prices self.closes = [] # Init websocket self.ws = WebSocket(self) # Setup the plot's process self.p = Process(target=self.plot_live_graph)