File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
investing_algorithm_framework/services/backtesting Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44from collections import defaultdict
55from datetime import datetime , timedelta , timezone
66from typing import Dict , List , Union
7+ from uuid import uuid4
78
89import numpy as np
910import pandas as pd
@@ -124,6 +125,8 @@ def create_vector_backtest(
124125 strategy: The strategy to backtest.
125126 backtest_date_range: The date range for the backtest.
126127 initial_amount: The initial amount to use for the backtest.
128+ risk_free_rate: The risk-free rate to use for the backtest
129+ metrics. Default is 0.027 (2.7%).
127130
128131 Returns:
129132 BacktestRun: The backtest run containing the results and metrics.
@@ -257,7 +260,7 @@ def create_vector_backtest(
257260 if current_signal == 1 and last_trade is None :
258261 amount = float (capital_for_trade / current_price )
259262 order = Order (
260- id = len ( orders ) + 1 ,
263+ id = uuid4 () ,
261264 target_symbol = symbol ,
262265 trading_symbol = trading_symbol ,
263266 order_type = OrderType .LIMIT ,
You can’t perform that action at this time.
0 commit comments