Skip to content

Commit 90fa2bf

Browse files
ChadThackraykernc
authored andcommitted
Update the current_values function to be private: _current_values
1 parent 5ac3e95 commit 90fa2bf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

β€Žbacktesting/_util.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def __get_array(self, key) -> _Array:
216216
arr = self.__cache[key] = cast(_Array, self.__arrays[key][:self.__len])
217217
return arr
218218

219-
def current_value(self, key: str):
219+
def _current_value(self, key: str):
220220
if self.__len <= 0:
221221
raise IndexError("No data available")
222222
return self.__arrays[key][self.__len - 1]

β€Žbacktesting/backtesting.pyβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def unrealized_pl(self) -> float:
838838
self._recalculate_trade_sums()
839839
if not self.trades:
840840
return 0.0
841-
current_price = float(self._data.current_value("Close"))
841+
current_price = float(self._data._current_value("Close"))
842842
return current_price * self._open_trade_size_sum - self._open_trade_entry_value_sum
843843

844844
@property
@@ -882,9 +882,9 @@ def next(self):
882882

883883
def _process_orders(self):
884884
data = self._data
885-
open_price = data.current_value("Open")
886-
high_price = data.current_value("High")
887-
low_price = data.current_value("Low")
885+
open_price = data._current_value("Open")
886+
high_price = data._current_value("High")
887+
low_price = data._current_value("Low")
888888
reprocess_orders = False
889889

890890
# Process orders

0 commit comments

Comments
Β (0)