aboutsummaryrefslogtreecommitdiff
path: root/algo.py
blob: 148d2627dc5d4efd5f19fa8a89fb6156ec65d5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from abc import ABC, abstractmethod

class Algo(ABC):
    """
    Function that takes in data nad determined whether to buy, sell, or hold
    current position is a float that represents the ratio from liquid to shares that you own
        i.e. 1.0 is $0 cash, all shares, 0.0 is max cash, 0 shares
    """
    @abstractmethod
    def detemine_signal(self, timestamps, prices, current_position):
        pass # to implement per algo

    """
    Function that returns an array of go.X plots to merge into graph foir analysis
    """
    @abstractmethod
    def export_graph(self, graph_data):
        pass # to implement per algo

    @property
    def name(self):
        pass 

    @property
    def graph_data(self):
        pass 

    # """
    # Function that takes in data and returns a buy, sell, or hold singal per interval
    # """
    # @abstractmethod
    # def backtest_algo(self):
    #     pass