Skip to content

stats ¤

OptimizeStatistic ¤

OptimizeStatistic(
    plotter: OptimizePlotter = None, total: int = 0
)

Compute strategy result

Source code in lettrade/exchange/backtest/stats.py
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, plotter: OptimizePlotter = None, total: int = 0) -> None:
    self.plotter = plotter
    self._total = total

    self.results = []
    self._result_thread = None

    if self.plotter is not None:
        self.plotter.init(self.results)

    self._t_wait_result()

compute ¤

compute()

Calculate strategy report

Source code in lettrade/exchange/backtest/stats.py
108
109
110
111
112
113
def compute(self):
    """
    Calculate strategy report
    """

    return self.result