(
self,
type: str,
symbol: str,
k: int = 1,
)
| 139 | print(f"Add recent history for {type} {symbol}.") |
| 140 | |
| 141 | def get_recent_history( |
| 142 | self, |
| 143 | type: str, |
| 144 | symbol: str, |
| 145 | k: int = 1, |
| 146 | ) -> List[Any]: |
| 147 | |
| 148 | assert k <= self.max_recent_steps, f"k = {k} should be less than max_recent_steps = {self.max_recent_steps}." |
| 149 | |
| 150 | recent_history = [] |
| 151 | recent_history_ = self._get_recent_history(type, symbol) |
| 152 | for item in recent_history_: |
| 153 | recent_history.append(item) |
| 154 | |
| 155 | if len(recent_history) < k: |
| 156 | res = recent_history |
| 157 | else: |
| 158 | res = recent_history[-k:] |
| 159 | |
| 160 | print(f"Get recent history for {type} {symbol}.") |
| 161 | return res |
| 162 | |
| 163 | def load_local( |
| 164 | self, |
nothing calls this directly
no test coverage detected