Skip to content

Commit 491ef00

Browse files
Fix read-only array error in FractionalBacktest indicator scaling
1 parent 6e9016c commit 491ef00

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backtesting/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ def run(self, **kwargs) -> pd.Series:
552552
trades[['EntryPrice', 'ExitPrice', 'TP', 'SL']] /= self._fractional_unit
553553

554554
indicators = result['_strategy']._indicators
555-
for indicator in indicators:
555+
for i, indicator in enumerate(indicators):
556556
if indicator._opts['overlay']:
557-
indicator /= self._fractional_unit
557+
indicators[i] = indicator / self._fractional_unit
558558

559559
return result
560560

0 commit comments

Comments
 (0)