diff options
author | loit <michael.foiani@gmail.com> | 2025-07-29 20:32:36 -0400 |
---|---|---|
committer | loit <michael.foiani@gmail.com> | 2025-07-29 20:32:36 -0400 |
commit | 4722ce02ff70cd30ceb11b0ffa93f4e53ca6f80c (patch) | |
tree | 24ba1b51f503153b4f8731ef6dd6788e663f4c0b /algo.py | |
parent | 0372b76ee22ea4421b70d6f7f8c2b29b2c7ac9dc (diff) |
begin infrastructure for automated backtesting, allowing for viewing details about the trial after
Diffstat (limited to 'algo.py')
-rw-r--r-- | algo.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,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
\ No newline at end of file |