Skip to content

Commit 648ed09

Browse files
committed
added get_available_cash in portfolio
1 parent 337df0d commit 648ed09

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/risk_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _calculate_atr(portfolio, ticker, period: int = 14) -> float:
143143
ATR value
144144
"""
145145
start_date = portfolio.date
146-
end_date = (datetime.strptime(start_date, '%Y-%m-%d') - timedelta(days=period)).strftime('%Y-%m-%d')
146+
end_date = start_date - timedelta(days=period)).strftime('%Y-%m-%d')
147147

148148
df = database.get_universe_data(start_date=start_date, end_date=end_date, ticker=ticker)
149149
if len(df) < 2:

0 commit comments

Comments
 (0)