added close position and trade session

This commit is contained in:
Oleg Sheynin
2025-07-16 18:06:33 +00:00
parent 20f150a6b7
commit 9c34d935bd
9 changed files with 1679 additions and 8107 deletions
+3 -2
View File
@@ -1,8 +1,8 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import Dict, Optional, cast
import pandas as pd # type: ignore[import]
import pandas as pd # type: ignore[import]
from pt_trading.results import BacktestResult
from pt_trading.trading_pair import TradingPair
@@ -22,7 +22,7 @@ class PairsTradingFitMethod(ABC):
@abstractmethod
def run_pair(
self, config: Dict, pair: TradingPair, bt_result: BacktestResult
self, pair: TradingPair, bt_result: BacktestResult
) -> Optional[pd.DataFrame]: ...
@abstractmethod
@@ -33,3 +33,4 @@ class PairState(Enum):
INITIAL = 1
OPEN = 2
CLOSED = 3
CLOSED_POSITIONS = 4