From 4722ce02ff70cd30ceb11b0ffa93f4e53ca6f80c Mon Sep 17 00:00:00 2001 From: loit Date: Tue, 29 Jul 2025 20:32:36 -0400 Subject: begin infrastructure for automated backtesting, allowing for viewing details about the trial after --- algo.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 algo.py (limited to 'algo.py') diff --git a/algo.py b/algo.py new file mode 100644 index 0000000..148d262 --- /dev/null +++ b/algo.py @@ -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 -- cgit v1.2.3-70-g09d2