mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-01 10:01:19 +08:00
* Use dict-like configuration * Rename from_neutrader to integration * SAOE strategy * Optimize file structure * Optimize code * Format code * create_state_maintainer_recursive * Remove explicit time_per_step * CI test passed * Resolve PR comments * Pass all CI * Minor test issue * Refine SAOE adapter logic * Minor bugfix * Cherry pick updates * Resolve PR comments * CI issues * Refine adapter & saoe_data logic * Resolve PR comments * Resolve PR comments * Rename ONE_SEC to EPS_T; complete backtest loop * CI issue * Resolve Yuge's PR comments
23 lines
499 B
Python
23 lines
499 B
Python
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
# REGION CONST
|
|
from typing import TypeVar
|
|
|
|
import numpy as np
|
|
import pandas as pd
|
|
|
|
REG_CN = "cn"
|
|
REG_US = "us"
|
|
REG_TW = "tw"
|
|
|
|
# Epsilon for avoiding division by zero.
|
|
EPS = 1e-12
|
|
|
|
# Infinity in integer
|
|
INF = int(1e18)
|
|
ONE_DAY = pd.Timedelta("1day")
|
|
ONE_MIN = pd.Timedelta("1min")
|
|
EPS_T = pd.Timedelta("1s") # use 1 second to exclude the right interval point
|
|
float_or_ndarray = TypeVar("float_or_ndarray", float, np.ndarray)
|