@@ -534,15 +534,17 @@ def __init__(self,
534
534
category = DeprecationWarning , stacklevel = 2 )
535
535
fractional_unit = 1 / kwargs .pop ('satoshi' )
536
536
self ._fractional_unit = fractional_unit
537
+ self .__data : pd .DataFrame = data .copy (deep = False ) # Shallow copy
538
+ for col in ('Open' , 'High' , 'Low' , 'Close' ,):
539
+ self .__data [col ] = self .__data [col ] * self ._fractional_unit
540
+ for col in ('Volume' ,):
541
+ self .__data [col ] = self .__data [col ] / self ._fractional_unit
537
542
with warnings .catch_warnings (record = True ):
538
543
warnings .filterwarnings (action = 'ignore' , message = 'frac' )
539
544
super ().__init__ (data , * args , ** kwargs )
540
545
541
546
def run (self , ** kwargs ) -> pd .Series :
542
- data = self ._data .copy ()
543
- data [['Open' , 'High' , 'Low' , 'Close' ]] *= self ._fractional_unit
544
- data ['Volume' ] /= self ._fractional_unit
545
- with patch (self , '_data' , data ):
547
+ with patch (self , '_data' , self .__data ):
546
548
result = super ().run (** kwargs )
547
549
548
550
trades : pd .DataFrame = result ['_trades' ]
0 commit comments