Skip to content

Commit 58951b3

Browse files
committed
fixed bug in calculate atr
1 parent f2b1bf1 commit 58951b3

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
@@ -144,7 +144,7 @@ def _calculate_atr(portfolio, ticker, period: int = 14) -> float:
144144
"""
145145

146146
end_date = portfolio.date
147-
start_date = (datetime.strptime(end_date, '%Y-%m-%d') - timedelta(days=period)).strftime('%Y-%m-%d')
147+
start_date = end_date - timedelta(days=period)
148148

149149

150150
logger.info(f"start_date : {start_date}")

0 commit comments

Comments
 (0)