Skip to content

Commit 3485f0c

Browse files
committed
Update the current_values function to be private: _current_values
1 parent ce0e21a commit 3485f0c

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
@@ -856,7 +856,7 @@ def unrealized_pl(self) -> float:
856856
self._recalculate_trade_sums()
857857
if not self.trades:
858858
return 0.0
859-
current_price = float(self._data.current_value("Close"))
859+
current_price = float(self._data._current_value("Close"))
860860
return current_price * self._open_trade_size_sum - self._open_trade_entry_value_sum
861861

862862
@property
@@ -900,9 +900,9 @@ def next(self):
900900

901901
def _process_orders(self):
902902
data = self._data
903-
open_price = data.current_value("Open")
904-
high_price = data.current_value("High")
905-
low_price = data.current_value("Low")
903+
open_price = data._current_value("Open")
904+
high_price = data._current_value("High")
905+
low_price = data._current_value("Low")
906906
reprocess_orders = False
907907

908908
# Process orders

0 commit comments

Comments
Β (0)